Instance Property

reasonForWaitingToPlay

The reason the player is currently waiting for playback to begin or resume.

Declaration

var reasonForWaitingToPlay: AVPlayer.WaitingReason? { get }

Discussion

When the value of the player’s timeControlStatus is AVPlayer.TimeControlStatus.waitingToPlayAtSpecifiedRate, you can use this property determine the reason the player is currently waiting for playback to begin or resume. Possible values for this property are:

The value of this property will be nil if the player’s timeControlStatus is a value other than AVPlayer.TimeControlStatus.waitingToPlayAtSpecifiedRate.

You can use the value of this property to conditionally show UI indicating the player's waiting state. This property is observable using Key-value observing.

See Also

Managing Automatic Waiting Behavior

var automaticallyWaitsToMinimizeStalling: Bool

A Boolean value that indicates whether the player should automatically delay playback in order to minimize stalling.

var timeControlStatus: AVPlayer.TimeControlStatus

A status that indicates whether playback is currently in progress, paused indefinitely, or suspended while waiting for appropriate network conditions.

func playImmediately(atRate: Float)

Plays the available media data immediately, at the specified rate.

struct AVPlayer.WaitingReason

The following are valid constant values for the player’s reasonForWaitingToPlay property.