Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML MediaPlayer and iOS

QML MediaPlayer and iOS

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 3 Posters 2.3k 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.
  • C Offline
    C Offline
    Critically
    wrote on last edited by
    #1

    Hello, I'm creating qml project on qt creator, qt 5.3. I'm using *.m4v file. When I'm compiling my project to Android it's working perfect, but in my iPhone i'm getting a blackScreen

       Video {
            id: video
            width: Screen.width
            height: Screen.height
            source: '1.m4v'
            focus: true
        }
    

    I'm trying to use MediaPlayer, but it is not work... can anyone help me please. Sry for bad ENG ((

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      AFAIK video playback is not possible in QML for iOS, only in QWidgets.
      Because it's not possible to write the video into OpenGL texture.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Critically
        wrote on last edited by
        #3

        Can u give some link or example how to do this with Qwidgets ?

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          minimal example to play video in C++/QWidget. See "this":http://doc.qt.io/qt-5/videooverview.html for further reading.
          @
          int main(int argc, char argv[])
          {
          QApplication a(argc, argv);
          QMainWindow w;
          QVideoWidget
          videoWidget = new QVideoWidget;
          QMediaPlayer* player = new QMediaPlayer;
          player->setMedia(QUrl(...));
          player->setVideoOutput(videoWidget);
          player->play();
          w.setCentralWidget(pVWidget);
          w.show();
          return a.exec();
          }
          @
          But i think your app is written in QML right?
          You would need to switch completely from QML to QWidgets.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Critically
            wrote on last edited by
            #5

            Thank you very much, i will try for switch completely from QML to QWidgets. ((

            P.S. It's so moodily ((

            1 Reply Last reply
            0
            • raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              but before you switch completely you should run a simple test (like the code i've posted) if it is really working for you.

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • A Offline
                A Offline
                agocs
                wrote on last edited by
                #7

                On the bright side support for video on iOS with Quick may come in Qt 5.5, so stay tuned.

                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