AVPlayerInterstitialEvent to schedule a priority alert during Live content.
I set the interstitial event to the events property of AVPlayerInterstitialEventController but the primary content never switches to the event at the specified Date.
I am able to successfully set an event when the primary content is VOD and the event plays as expected.
I have confirmed:
- The HLS playlist for the primary asset contains
EXT-X-PROGRAM-DATE-TIMEtag so the Event can be mapped into theprimaryItemtimeline. - The
dateproperty of theAVPlayerInterstitialEventis sufficiently ahead (> 60 seconds) of the current playback time. - Using Charles Proxy, I do not see any player networking for the Event's URL.
Here is a code snippet to show how the event is created and scheduled:
let currentItem = player.currentItem
let event = AVPlayerInterstitialEvent(primaryItem: currentItem,
\identifier: evt.id,
date: evt.date,
templateItems: [AVPlayerItem(url: evt.url)],
restrictions: [],
resumptionOffset: CMTime.indefinite)
event.willPlayOnce = true
eventController.events = [event]
I have also attached example HLS for the Live content and Event.
Any help is appreciated.