Qt Forum

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

    Unsolved Registering type based on AVFMediaPlayerSession

    Installation and Deployment
    2
    4
    628
    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.
    • W
      Wiru last edited by

      I'm not that experienced with this type of work, but I was wondering if it is possible to take avfmediaplayer out of the qtmultimedia module and make a separate type using qmlRegisterType. The reason is that I just need to add a small modification (DRM support) to the IOS part of the MediaPlayer.
      I managed to use AVPlayer to play the "video" (sound only, since no surface) like this:

      ViewRightKeyLoaderDelegate *loaderDelegate;
      
      AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:movieURL options:nil];
      loaderDelegate = [[ViewRightKeyLoaderDelegate alloc] init];
      [[asset resourceLoader] setDelegate:loaderDelegate queue:dispatch_get_main_queue()];
      
      playerItem = [[[AVPlayerItem alloc] initWithAsset:asset] autorelease] ;
      player = [[[AVPlayer alloc] initWithPlayerItem:playerItem] autorelease];
      
      AVPlayerViewController *playerViewController = [[AVPlayerViewController alloc] init];
      playerViewController.player = player;
      [player play];
      

      And since AVFMediaPlayer is based on AVPlayer I figured it should work like this.

      So one option that I was thinking about is to make a separate type which would be the best solution (I guess), since it would be based on the MediaPlayer itself and hopefully just forwarding it to VideoOutput and have it displayed without having to create a new surface for it. I already tried this part, but end up with error: call to implicitly-deleted default constructor of 'QQmlElement<AVFMediaPlayerSession>' , so hoping there is some way to fix this.

      Other option would be to build it from source with the added DRM support, but so far I don't fully understand how it's done (I did read the wiki about it, but need to do it few more times to understand).

      If anyone has any better ideas, I'm open for suggestions.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        It's a bit more complex than that due to integration with the GUI architecture.

        Building Qt from source for iOS is not that complex, see Building From Source for iOS.

        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 Reply Quote 0
        • W
          Wiru last edited by Wiru

          Currently I'm trying to make the custom build from source. I saw the Qt Documentation, but I think it's not informative enough. There is no info on how to build just one module without the whole QT, and the IOS part, I'm using Xcode v9.2 and there is no Download option under preferences . I found how to build just one module, but I wonder if it will work, since DRM lib requires an additional step with a finalize script, in the time of writing I'm still doing the modification parts so I'll see if it works later.

          If that wont work, has anyone ever tried making a native IOS player component, or how can I make a surface for AVPlayer?

          EDIT: the modified build seems to work correctly so far

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Only one module is the same as any other Qt project: qmake, make -(jnumber_of_cores_) * (3 +1), make install.

            I'd recommend an out of source build so it's easier to manage.

            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 Reply Quote 0
            • First post
              Last post