Shareplay for custom video controls playback

Hi

We are trying to implement Group watching feature with the help of Group Activities available in iOS 15 onwards

We can share the session across the user, and the proper content is launched in the Player. Now we need to coordinate the player activity. We are using custom video controls over AVPlayer and it seems by default calling the below line of code does not seems to be work.

player?.playbackCoordinator.coordinateWithSession(session)

Now we are stuck with coordinating player activity.

The example mentions default controls with AVPlayer, but in our case, we have custom video controls on top of AVPlayer.

https://developer.apple.com/videos/play/wwdc2021/10225/

So will the player automatically coordinate with the group session, or do we need to implement AVDelegatingPlaybackCoordinator for the same.

Please help!

For what it's worth, I am able to get SharePlay to work with a AVPlayer based system (custom controls). The logic is that after we receive the activity, we create our player and during the process of configuring the player, if there is a group session we attach it to the playbackCoordinator. Hope that helps.

    if #available(iOS 15, *) {
      if let session = CoordinationManager.shared.groupSession {
        player.playbackCoordinator.coordinateWithSession(session)
      }
    }
Shareplay for custom video controls playback
 
 
Q