Contents

init(url:)

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

Declaration

nonisolated 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