Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QAbstractVideoSurface for play video in qml

QAbstractVideoSurface for play video in qml

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • BharathiB Offline
    BharathiB Offline
    Bharathi
    wrote on last edited by
    #1

    How to use QAbstractVideoSurface for play video in qml??
    After executing the file I get error in header file
    */ mymediaplayer.h
    public slots:

    void setVideoSurface(QAbstractVideoSurface surface);
    QAbstractVideoSurface getVideoSurface();

    error: cannot declare parameter 'surface' to be of abstract type 'QAbstractVideoSurface'
    void setVideoSurface(QAbstractVideoSurface surface);

    I get the error as above mentioned. ^

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      First thing to do: you should pass a pointer to your QAbstractVideoSurface.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • BharathiB Offline
        BharathiB Offline
        Bharathi
        wrote on last edited by
        #3

        After clearing those errors,
        @
        MyMediaPlayer* player = new MyMediaPlayer();
        QQuickView view;
        view.engine()->rootContext()->setContextProperty("mediaplayer", player);
        player->setMedia(QUrl::fromLocalFile("C:/Users/bharathiraja/Desktop/video.mp4"));
        player->play();
        @
        error: invalid use of incomplete type 'class QQmlEngine'
        forward declaration of class QQmlEngine

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're missing the include of QQmlEngine.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • BharathiB Offline
            BharathiB Offline
            Bharathi
            wrote on last edited by
            #5

            got it thanks for the reply...

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved