Instance Method

replaceCurrentItemWithPlayerItem:

Replaces the current player item with a new player item.

Declaration

- (void)replaceCurrentItemWithPlayerItem:(AVPlayerItem *)item;

Parameters

item

A player item.

Discussion

The player item replacement occurs immediately and item becomes the player’s currentItem. Calling this method with the player’s current player item has no effect.

You can use Key-value observing to observe changes to the player’s currentItem property.

Special Considerations

The new item must have the same compositor as the item it replaces, or have no compositor.

See Also

Managing Playback

- play

Begins playback of the current item.

- pause

Pauses playback of the current item.

rate

The current playback rate.

actionAtItemEnd

The action to perform when the current player item has finished playing.

AVPlayerActionAtItemEnd

The actions a player should take when it finishes playing.

preventsDisplaySleepDuringVideoPlayback

A Boolean value that indicates whether video playback prevents display and device sleep.