Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Help in creating custom MediaPlayer component
QtWS25 Last Chance

Help in creating custom MediaPlayer component

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
qmlobjective-ccppmediaplayerios
12 Posts 2 Posters 2.6k Views
  • 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.
  • W Offline
    W Offline
    Wiru
    wrote on 16 Jan 2019, 15:34 last edited by
    #1

    I have been trying to create a custom player for iOS but the surface creation proved to be quite complicated to understand, so I was thinking if it's possible to just create a custom MediaPlayer that we pass to QML-s VideoOutput component, so that it handles the video render for me.

    Something like this:

    import QtQuick 2.9
    import QtQuick.Window 2.3
    import QtQuick.Controls 2.2
    import QtMultimedia 5.9
    import QtQuick.Layouts 1.3
    
    //import MyCustomPlayer 1.0
    
    ApplicationWindow {
        visible: true
        visibility: Window.FullScreen
    
        // this would be replaced with my custom MediaPlayer defined in "MyCustomPlayer 1.0"
        MediaPlayer { 
            id: player
            source: "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"
            autoPlay: true
        }
    
        VideoOutput {
            id: videoOutput
            source: player
            anchors.fill: parent
        }
    }
    

    This way I would just pass my custom player to VideoOutput.

    Since the custom player should be quite similar to the original MediaPlayer it self, I was looking at the source code from qtmediaplayer trying to understand how the implementation works.

    I know how to make a basic component using qmlRegisterType but what are the minimum steps to have the component working (receive a video source and passing it to VideoOutput).
    As far as I understand the majority of the code for iOS player is placed in avfoundation folder.

    Or is it possible to include <QtMultimedia/qmediaplayer.h> and override some of its functionality to create the custom component?

    If anyone has done something similar it would greatly help.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 16 Jan 2019, 23:07 last edited by
      #2

      Hi,

      What would your custom player do ?

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

      W 1 Reply Last reply 17 Jan 2019, 00:40
      0
      • S SGaist
        16 Jan 2019, 23:07

        Hi,

        What would your custom player do ?

        W Offline
        W Offline
        Wiru
        wrote on 17 Jan 2019, 00:40 last edited by
        #3

        @SGaist
        For the most part it would function same as the MediaPlayer, but I require additional functionality for widevine drm, so that would be the custom part.

        Even getting the original MediaPlayer as a separate component for my project would greatly help.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 17 Jan 2019, 22:39 last edited by
          #4

          At what level is that technology integrated ? Shouldn't that be through the OS frameworks ?

          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
          • W Offline
            W Offline
            Wiru
            wrote on 18 Jan 2019, 09:54 last edited by
            #5

            It's on lower lvl, requiring a localhost to run which transforms mpd streams to hls because native iOS does not support mpd format, which is then sent to the player.

            But that's not the issue here, just getting a separate component like MediaPlayer would solve all integration problems.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 18 Jan 2019, 22:20 last edited by
              #6

              In that case, you should take a look at the plugins in QtMultimedia's sources, you have several implementations that you can take inspiration from thus integrating directly in the pipeline rather that having a custom item.

              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
              • W Offline
                W Offline
                Wiru
                wrote on 21 Jan 2019, 08:42 last edited by
                #7

                I assume with integration into the pipeline you mean to compile it with the changes?
                If that's the case, then it's out of question due to complexity of the integration itself.
                I managed to get native iOS player in a custom component so I'll continue with that.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 21 Jan 2019, 22:48 last edited by
                  #8

                  No, I mean to make it a plugin so it can be loaded to play your custom type.

                  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
                  • W Offline
                    W Offline
                    Wiru
                    wrote on 22 Jan 2019, 08:49 last edited by
                    #9

                    How would such an approach look like? So far I haven't done anything with plugins.
                    If it's possible to modify avplayer asset and delegate from original MediaPlayer I'd like to try it, but I would need some guide on how to do it.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 22 Jan 2019, 22:19 last edited by
                      #10

                      Did you take a look at the QtMultimedia media player plugins ?

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

                      W 1 Reply Last reply 23 Jan 2019, 01:09
                      0
                      • S SGaist
                        22 Jan 2019, 22:19

                        Did you take a look at the QtMultimedia media player plugins ?

                        W Offline
                        W Offline
                        Wiru
                        wrote on 23 Jan 2019, 01:09 last edited by
                        #11

                        Yes I did, but I never made anything like this, so not much that i understand from there.

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 24 Jan 2019, 22:47 last edited by
                          #12

                          Then study the gstreamer implementation for example and start from there.

                          The pattern is to have a "session class" that does the work and then provide all the interfaces you support that will be using said session class.

                          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

                          1/12

                          16 Jan 2019, 15:34

                          • Login

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