Instance Method

initWithURL:

Creates a new player to play a single audiovisual resource referenced by a given URL.

Declaration

- (instancetype)initWithURL:(NSURL *)URL;

Parameters

URL

A URL that identifies an audiovisual resource.

Return Value

A new player instance initialized to play the audiovisual resource specified by URL.

Discussion

This method implicitly creates an AVPlayerItem object. You can get the player item using currentItem.

See Also

Creating a Player

+ playerWithURL:

Returns a new player to play a single audiovisual resource referenced by a given URL.

- initWithPlayerItem:

Creates a new player to play the specified player item.

+ playerWithPlayerItem:

Returns a new player initialized to play the specified player item.