Type Method

playerItemWithAsset:

Returns a new player item for a given asset.

Declaration

+ (instancetype)playerItemWithAsset:(AVAsset *)asset;

Parameters

asset

The AVAsset to be played.

Return Value

A new player item, initialized to play asset.

Discussion

This method is equivalent to invoking playerItemWithAsset:automaticallyLoadedAssetKeys:, passing ["duration"] as the value of automaticallyLoadedAssetKeys.

See Also

Creating a Player Item

- initWithURL:

Initializes a player item with a given URL.

+ playerItemWithURL:

Returns a new player item, prepared to use a given URL.

- initWithAsset:

Initializes a new player item for a given asset.

- initWithAsset:automaticallyLoadedAssetKeys:

Initializes a player item with the specified asset and the asset keys to be automatically loaded.

+ playerItemWithAsset:automaticallyLoadedAssetKeys:

Creates a player item with the specified asset and the asset keys to be automatically loaded.