Instance Property

requiresLinearPlayback

A Boolean value that determines whether the player allows the user to skip media content.

Declaration

var requiresLinearPlayback: Bool { get set }

Discussion

If this value is false (the default), the controller’s user interface allows a user to fast-forward, scrub, or skip ahead to content later in the player’s presentation. To prevent the user from skipping content—for example, while presenting a legal notice or other mandatory interstitial content—set this property’s value to true.

To track when the player is presenting content for which you might require linear playback, use the interstitialTimeRanges property of the view controller’s player item to define the time ranges of the interstitial content. The view controller then sends playerViewController(_:willPresent:) and playerViewController(_:didPresent:) messages to its delegate object when the content is playing. Implement these methods to enable or disable the requiresLinearPlayback property as needed.

See Also

Configuring the Player View Controller

var showsPlaybackControls: Bool

A Boolean value that indicates whether the player view controller shows playback controls.

var playbackControlsIncludeInfoViews: Bool

A Boolean value that indicates whether the player shows information views when requested by the user.

var playbackControlsIncludeTransportBar: Bool

A Boolean value that indicates whether the player shows the transport bar and related controls.

var allowsPictureInPicturePlayback: Bool

A Boolean value that indicates whether the player allows Picture in Picture playback.

var contentOverlayView: UIView?

A view displayed between the video content and the playback controls.

var entersFullScreenWhenPlaybackBegins: Bool

A Boolean value that determines whether the player automatically displays in full screen when the user taps the play button.

var exitsFullScreenWhenPlaybackEnds: Bool

A Boolean value that indicates whether the player exits full-screen mode when playback ends.

var isReadyForDisplay: Bool

A Boolean value that indicates that the player item’s first video frame is ready for display.

var videoBounds: CGRect

The current size and position of the video image as displayed within the bounds of the player view controller’s view.

var videoGravity: AVLayerVideoGravity

A string that specifies how the video displays within the bounds of the player view controller’s view.

var unobscuredContentGuide: UILayoutGuide

A layout guide representing an area that won’t be permanently obscured by fixed-position playback controls when they’re visible.

var updatesNowPlayingInfoCenter: Bool

A Boolean value that indicates whether the player view controller updates the Now Playing info center.

var appliesPreferredDisplayCriteriaAutomatically: Bool

A Boolean value that indicates whether the player view controller automatically sets the screen’s display criteria to match that of the currently playing asset.

var customInfoViewController: UIViewController?

A view controller that provides client-specific content and controls alongside system-provided information and settings panels.

var customOverlayViewController: UIViewController?

A view controller that presents custom content over the player view controller’s view.

var pixelBufferAttributes: [String : Any]?

The pixel buffer attributes of the video frames presented during playback.