Protocol: MPMediaPlayback

Overview

The MPMediaPlayback protocol defines the interface adopted by the MPMoviePlayerController class for controlling media playback. This protocol supports basic transport operations including start, stop, and pause, and also lets you seek forward and back through a movie or to a specific point in its timeline. The current playback rate for the player. (required)The current position of the playhead. (required)A Boolean value indicating whether a movie player is ready to play. (required) (read-only)Begins seeking backward through the media content. (required)Begins seeking forward through the media content. (required)Ends forward and backward seeking through the media content. (required)Pauses playback of the current item. (required)Initiates playback of the current item. (required)Prepares a movie player for playback. (required)Ends playback of the current item. (required)

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Float) currentPlaybackRate

The current playback rate for the player. (required) This value represents a multiplier for the default playback rate of the current item. A value of 0.0 indicates that playback is stopped while a value of 1.0 indicates that playback is occurring at normal speed. Positive values indicate forward playback while negative values indicate reverse playback. Setting the value of this property changes the playback rate accordingly.

Returns:

- (NSTimeInterval) currentPlaybackTime

The current position of the playhead. (required) For video-on-demand or progressively downloaded content, this value is measured in seconds from the beginning of the current item. Changing the value of this property moves the playhead to the new location. For content streamed live from a server, this value represents the time from the beginning of the playlist when it was first loaded.

Returns:

  • (NSTimeInterval)

- (Boolean) isPreparedToPlay (readonly)

A Boolean value indicating whether a movie player is ready to play. (required) (read-only)

Returns:

  • (Boolean)

Instance Method Details

- (Object) beginSeekingBackward

Begins seeking backward through the media content. (required) Use this method to move the current playback position backward in time at an accelerated rate. Seeking begins when you call this method and continues until you call the endSeeking method. If the underlying content is streamed, this method has no effect.

Returns:

- (Object) beginSeekingForward

Begins seeking forward through the media content. (required) Use this method to move the current playback position forward in time at an accelerated rate. Seeking begins when you call this method and continues until you call the endSeeking method. If the underlying content is streamed, this method has no effect.

Returns:

- (Object) endSeeking

Ends forward and backward seeking through the media content. (required) You must call this method to end a seeking operation begun by calling either the beginSeekingBackward or beginSeekingForward method. After calling this method, the player returns to the same state it was in prior to seeking. In other words, if the item was playing before seeking began, it continues playing from the new playhead position after calling this method.If the underlying content is streamed, this method has no effect.

Returns:

- (Object) pause

Pauses playback of the current item. (required) If playback is not currently underway, this method has no effect. To resume playback of the current item from the pause point, call the play method.

Returns:

- (Object) play

Initiates playback of the current item. (required) If playback was previously paused, this method resumes playback where it left off; otherwise, this method plays the first available item, from the beginning.If a movie player is not prepared for playback when you call this method, this method first prepares the movie player and then starts playback. To minimize playback delay, call the prepareToPlay method before you call this method.To be notified when a movie player is ready to play, register for the MPMoviePlayerLoadStateDidChangeNotification notification. You can then check load state by accessing the movie player’s loadState property.

Returns:

- (Object) prepareToPlay

Prepares a movie player for playback. (required) If a movie player is not already prepared to play when you call the play method, that method automatically calls this method. However, to minimize playback delay, call this method before you call play.Calling this method may interrupt the movie player’s audio session. For information on interruptions and how to resond to them, see Audio Session Programming Guide.

Returns:

- (Object) stop

Ends playback of the current item. (required) This method stops playback of the current item and resets the playhead to the start of the item. Calling the play method again initiates playback from the beginning of the item.

Returns: