init(primaryItem:identifier:date:templateItems:restrictions:resumptionOffset:playoutLimit:userDefinedAttributes:)
Creates an interstitial event, with user-defined attributes, for the specified date.
Declaration
convenience init(primaryItem: AVPlayerItem, identifier: String?, date: Date, templateItems: [AVPlayerItem], restrictions: AVPlayerInterstitialEvent.Restrictions = [], resumptionOffset: CMTime = .indefinite, playoutLimit: CMTime = .invalid, userDefinedAttributes: [String : Any] = [:])Parameters
- primaryItem:
The player item that represents the primary content. The item must contain an Avasset that provides intrinsic mappings from its timeline to real-time dates.
- identifier:
An external identifier for the event.
- date:
A date within the date range of the primary item that playback of interstitial content begins.
- templateItems:
An array of player item configurations to use as templates for player items that play interstitial content.
- restrictions:
Restrictions on access to playback controls during the event.
- resumptionOffset:
The time offset for resuming playback of the primary content after interstitial content finishes. You can specify a definite time, or specify Indefinite to indicate that the effective resumption time offset needs to align with time elapsed during interstitial playback.
- playoutLimit:
The time offset from the beginning of the interstitial when interstitial playback needs to end, if interstitial assets are longer. Pass a positive numeric value, or Invalid to indicate no play out limit.
- userDefinedAttributes:
Custom attributes to add to the event.