Instance Method

playImmediately(atRate:)

Immediately plays the available media data at the specified rate.

Declaration

func playImmediately(atRate rate: Float)

Parameters

rate

The specified playback rate.

Discussion

This method plays the available media data at the specified rate regardless of whether there is sufficient media buffered to ensure smooth playback. If media data exists in the playback buffer, calling this method changes the player’s playback rate to the specified rate and its timeControlStatus to a value of playing. If the player has insufficient media data buffered to begin playback, the player will behave as if it has encountered a stall during playback, except that no AVPlayerItemPlaybackStalled will be posted.

See Also

Managing Automatic Waiting Behavior

var automaticallyWaitsToMinimizeStalling: Bool

Indicates if the player should automatically delay playback in order to minimize stalling.

var reasonForWaitingToPlay: AVPlayer.WaitingReason?

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

var timeControlStatus: AVPlayerTimeControlStatus

Indicates whether playback is currently in progress, paused indefinitely, or suspended while waiting for appropriate network conditions.

struct AVPlayer.WaitingReason

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