-
What’s new in HLS Interstitials
HLS Interstitials can help you create seamless transitions in video content between advertisements, other interstitials, and your HLS streams. Learn how you can optimize your ad inventory, fine-tune interstitial presentation with SNAP-IN/OUT when using HLS, and more.
Recursos
Videos relacionados
WWDC22
WWDC21
-
Buscar este video…
-
-
7:58 - Client schedules an ad pod at 10s into primary asset
// Client schedules an ad pod at 10s into primary asset let player = AVPlayer( url: movieURL ) // no ads in primary asset let controller = AVPlayerInterstitialEventController( primaryPlayer: player ) let adPodTemplates = [AVPlayerItem( url: ad1URL ), AVPlayerItem( url: ad2URL )] let event = AVPlayerInterstitialEvent( primaryItem: player.currentItem, time: CMTime( seconds: 10, preferredTimescale: 1 ), ) event.templateItems = adPodTemplates event.identifier = "Ad1" event.restrictions = [] event.resumptionOffset = .zero event.playoutLimit = .invalid event.cue = .none controller.events = [event] player.currentItem.translatesPlayerInterstitialEvents = true let vc = AVPlayerViewController() vc.player = player player.play()
-