init(primaryItem:identifier:time:templateItems:restrictions:resumptionOffset:playoutLimit:userDefinedAttributes:)
Creates an interstitial event, with user-defined attributes, for the specified time.
Declaration
convenience init(primaryItem: AVPlayerItem, identifier: String?, time: CMTime, 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.
- time:
The time in the primary item’s timeline for playback of interstitial content to begin.
- 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.