events
The current schedule of interstitial events.
Declaration
var events: [AVPlayerInterstitialEvent]! { get set }Discussion
Setting this property to a non-nil value cancels and overrides all previously scheduled future interstitial events, including those that the primary item’s content specifies, such as directives carried by an HLS media playlists. Setting the value to an empty array clears the schedule or, if the server specifies interstitial events, reverts it to the server’s schedule.
Changing the value of this property doesn’t impact currently playing interstitials. To cancel the current event, call cancelCurrentEvent(withResumptionOffset:).
If you schedule interstitial events with dates that coincide either with the date of another scheduled interstitial event, or with a date range in the primary content’s timeline that the resumption offset of another scheduled interstitial event omits, the primary content remains suspended until all coinciding interstitial events complete. The system orders their playback according to their position in the array. The effective resumption offset is the sum of the resumption offsets of the coinciding events.