Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    QML MediaPlayer and iOS

    QML and Qt Quick
    3
    7
    1934
    Loading More Posts
    • 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
      Critically last edited by

      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 Reply Quote 0
      • raven-worx
        raven-worx Moderators last edited by

        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 Reply Quote 0
        • C
          Critically last edited by

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

          1 Reply Last reply Reply Quote 0
          • raven-worx
            raven-worx Moderators last edited by

            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 Reply Quote 0
            • C
              Critically last edited by

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

              P.S. It's so moodily ((

              1 Reply Last reply Reply Quote 0
              • raven-worx
                raven-worx Moderators last edited by

                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 Reply Quote 0
                • A
                  agocs last edited by

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

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post