<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVURLAsset",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVURLAsset"
  },
  "title" : "AVURLAsset"
}
-->

# AVURLAsset

An asset that represents media at a local or remote URL.

```
class AVURLAsset
```

## Overview

This class is a concrete subclass of [`AVAsset`](/documentation/AVFoundation/AVAsset). When you create an asset as shown below, the system creates and returns an instance of [`AVURLAsset`](/documentation/AVFoundation/AVURLAsset).

```swift
// A local or remote asset URL.
guard let url: URL = Bundle.main.url(forResource: "Image",
                                     withExtension: "png") else { return }
let asset = AVAsset(url: url)
```

In many cases, this is an appropriate way to create asset instances, but you can also directly instantiate an [`AVURLAsset`](/documentation/AVFoundation/AVURLAsset) when you need more fine-grained control over its initialization. The initializer for [`AVURLAsset`](/documentation/AVFoundation/AVURLAsset) accepts an options dictionary, which you use to customize the asset’s initialization for your particular purpose. For example, if you’re creating an asset for an HLS stream, you may want to prevent it from retrieving its media when it connects over a cellular network. You can do this by providing the initialization option and value as shown below.

```swift
let url: URL = // A remote asset URL.
let options = [AVURLAssetAllowsCellularAccessKey: false]
let asset = AVURLAsset(url: url, options: options)
```

## Topics

### Creating an asset

[`init(url:)`](/documentation/AVFoundation/AVURLAsset/init(url:))

Creates an asset that models the media at the specified URL.

[`init(url:options:)`](/documentation/AVFoundation/AVURLAsset/init(url:options:)-2x8uu)

Creates an asset that models the media resource at the specified URL.

[`URLAssetWithURL:options:`](/documentation/AVFoundation/AVURLAsset/URLAssetWithURL:options:)

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

[Initialization options](/documentation/AVFoundation/avurlasset-initialization-options)

Specify options to configure the initialization of a media asset.

### Loading tracks

[`tracks`](/documentation/AVFoundation/AVPartialAsyncProperty/tracks-44ptx)

The tracks an asset contains.

[`findCompatibleTrack(for:completionHandler:)`](/documentation/AVFoundation/AVURLAsset/findCompatibleTrack(for:completionHandler:))

Loads an asset track from which you can insert any time range into the composition track.

### Loading variants

[`variants`](/documentation/AVFoundation/AVPartialAsyncProperty/variants)

An array of variants that an asset contains.

### Determining supported media types

[`audiovisualTypes()`](/documentation/AVFoundation/AVURLAsset/audiovisualTypes())

Returns an array of the file types the asset supports.

[`audiovisualMIMETypes()`](/documentation/AVFoundation/AVURLAsset/audiovisualMIMETypes())

Returns an array of the MIME types the asset supports.

[`isPlayableExtendedMIMEType(_:)`](/documentation/AVFoundation/AVURLAsset/isPlayableExtendedMIMEType(_:))

Returns a Boolean value that indicates whether the asset is playable with the specified codecs and container type.

[`audiovisualContentTypes`](/documentation/AVFoundation/AVURLAsset/audiovisualContentTypes)

Provides the content types the AVURLAsset class understands.

### Assisting with resource loading

[`resourceLoader`](/documentation/AVFoundation/AVURLAsset/resourceLoader)

The resource loader for the asset.

[`mayRequireContentKeysForMediaDataProcessing`](/documentation/AVFoundation/AVURLAsset/mayRequireContentKeysForMediaDataProcessing)

A Boolean value that indicates whether you can add this asset as a content key recipient to a content key session.

### Working with offline assets

[`assetCache`](/documentation/AVFoundation/AVURLAsset/assetCache)

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

### Accessing the media URL

[`url`](/documentation/AVFoundation/AVURLAsset/url)

A URL to the asset’s media.

### Accessing asset variants

[`variants`](/documentation/AVFoundation/AVURLAsset/variants)

An array of variants that an asset contains.

### Accessing compatible tracks

[`compatibleTrack(for:)`](/documentation/AVFoundation/AVURLAsset/compatibleTrack(for:))

Returns an asset track from which you can insert any time range into a given composition track.

### Accessing the session identifier

[`httpSessionIdentifier`](/documentation/AVFoundation/AVURLAsset/httpSessionIdentifier)

A session identifier that the asset sends in HTTP requests that it makes.

### Accessing Media Extension properties

[`mediaExtensionProperties`](/documentation/AVFoundation/AVURLAsset/mediaExtensionProperties)

The properties of the media extension format reader that decodes the asset.

[`AVMediaExtensionProperties`](/documentation/AVFoundation/AVMediaExtensionProperties)

An object that describes a Media Extension.

[`sidecarURL`](/documentation/AVFoundation/AVURLAsset/sidecarURL)

The sidecar URL used by the MediaExtension.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)