AVURLAsset is a concrete subclass of AVAsset that you use to initialize an asset from a local or remote URL.


Creating an URL Asset

init(url:​ URL, options:​ [String :​ Any]? = nil)

Initializes an asset that models the media resource found at the specified URL.

Accessing the URL

var url:​ URL

The URL with which the asset was initialized.

Accessing the Resource Loader

var resource​Loader:​ AVAsset​Resource​Loader

The resource loader associated with the asset.

Finding Compatible Tracks

func compatible​Track(for:​ AVComposition​Track)

Returns an asset track from which any time range can be inserted into a given composition track.

Getting Supported Media Types

class func audiovisual​MIMETypes()

Returns an array of the MIME types the AVURLAsset class supports.

class func audiovisual​Types()

Returns an array of the file types the AVURLAsset class supports.

class func is​Playable​Extended​MIMEType(String)

Returns a Boolean value that indicates whether the asset is playable with the given codec(s) and container type.

Working with Offline Assets

var asset​Cache:​ AVAsset​Cache?

The asset’s associated asset cache, if it exists.



These constants can be passed in to AVURLAsset​HTTPCookies​Key to control the resolution of references to external media data.

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