Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2022 App ServicesAudio & Video

WWDC22 · 11 min · App Services / Audio & Video

Display ads and interstitials in SharePlay

Find out how you can deliver a coordinated playback experience in SharePlay when your app delivers different ad schedules to each participant. We’ll explore how to build playback experiences with stitched-in ads and scheduled HLS interstitials, and share tips and best practices.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 1 snippet

Specific sample accurate time ranges that represent ads or interstitials swift · at 5:13 ↗
class MyAVPlayerCoordinatorDelegate : NSObject, AVPlayerPlaybackCoordinatorDelegate
{   
    func playbackCoordinator(_ coordinator: AVPlayerPlaybackCoordinator,
    interstitialTimeRangesFor playerItem: AVPlayerItem) -> [NSValue]
 {
        return interstitialTimeRanges
     }
}