Initializer

init(url:)

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

Declaration

init(url URL: 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

init(playerItem: AVPlayerItem?)

Creates a new player to play the specified player item.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software