How can I implement share play into my media streaming app

Asked on 08/19/2024

1 search

To implement SharePlay into your media streaming app, you can follow these guidelines based on the content presented at WWDC:

  1. Adopt SharePlay for VisionOS: SharePlay allows you to extend the shared context provided by FaceTime to your app. When you adopt SharePlay on VisionOS, ensure your app's UI is synchronized between all participants on the call. This creates the illusion that participants are using a single copy of your app in a shared space. You can learn more about designing SharePlay experiences for spatial Personas in the session Customize spatial Persona templates in SharePlay.

  2. Integrate SharePlay with AVKit: If your app uses AVKit for media playback, you can synchronize the environment state as well. Use a group session to synchronize shareable content between devices. Pass the session to the AVPlayer's AVPlaybackCoordinator to sync the viewing environment. This allows participants to share the same immersive watching experience. More details can be found in the session Enhance the immersion of media viewing in custom environments.

  3. Enable SharePlay with HLS Interstitials: If your app supports HLS interstitials, you can coordinate these during a SharePlay session. This ensures that both players in a coordinated session remain in sync during playback, including during seeks and transitions. For more information, refer to the session Enhance ad experiences with HLS interstitials.

By following these steps, you can create a seamless and immersive SharePlay experience in your media streaming app.