<!--
{
  "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

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

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

[`init(url: URL, options: [String : Any]?)`](/documentation/AVFoundation/AVURLAsset/init(url:options:)-2x8uu)

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

[`+ (instancetype) URLAssetWithURL:(NSURL *) URL options:(NSDictionary<NSString *,id> *) 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

[`static var tracks: AVAsyncProperty<Root, [AVAssetTrack]>`](/documentation/AVFoundation/AVPartialAsyncProperty/tracks-44ptx)

The tracks an asset contains.

[`func findCompatibleTrack(for: AVCompositionTrack, completionHandler: (AVAssetTrack?, (any Error)?) -> Void)`](/documentation/AVFoundation/AVURLAsset/findCompatibleTrack(for:completionHandler:))

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

### Loading variants

[`static var variants: AVAsyncProperty<Root, [AVAssetVariant]>`](/documentation/AVFoundation/AVPartialAsyncProperty/variants)

An array of variants that an asset contains.

### Determining supported media types

[`class func audiovisualTypes() -> [AVFileType]`](/documentation/AVFoundation/AVURLAsset/audiovisualTypes())

Returns an array of the file types the asset supports.

[`class func audiovisualMIMETypes() -> [String]`](/documentation/AVFoundation/AVURLAsset/audiovisualMIMETypes())

Returns an array of the MIME types the asset supports.

[`class func isPlayableExtendedMIMEType(String) -> Bool`](/documentation/AVFoundation/AVURLAsset/isPlayableExtendedMIMEType(_:))

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

[`class var audiovisualContentTypes: [UTType]`](/documentation/AVFoundation/AVURLAsset/audiovisualContentTypes)

Provides the content types the AVURLAsset class understands.

### Assisting with resource loading

[`var resourceLoader: AVAssetResourceLoader`](/documentation/AVFoundation/AVURLAsset/resourceLoader)

The resource loader for the asset.

[`var mayRequireContentKeysForMediaDataProcessing: Bool`](/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

[`var assetCache: AVAssetCache?`](/documentation/AVFoundation/AVURLAsset/assetCache)

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

### Accessing the media URL

[`var url: URL`](/documentation/AVFoundation/AVURLAsset/url)

A URL to the asset’s media.

### Accessing asset variants

[`var variants: [AVAssetVariant]`](/documentation/AVFoundation/AVURLAsset/variants)

An array of variants that an asset contains.

### Accessing compatible tracks

[`func compatibleTrack(for: AVCompositionTrack) -> AVAssetTrack?`](/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

[`var httpSessionIdentifier: UUID`](/documentation/AVFoundation/AVURLAsset/httpSessionIdentifier)

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

### Accessing Media Extension properties

[`var mediaExtensionProperties: AVMediaExtensionProperties?`](/documentation/AVFoundation/AVURLAsset/mediaExtensionProperties)

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

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

An object that describes a Media Extension.

[`@property (nonatomic, readonly, nullable) NSURL * sidecarURL;`](/documentation/AVFoundation/AVURLAsset/sidecarURL)

The sidecar URL used by the MediaExtension.

### Initializers

[`init(URL: URL, options: [String : Any]?)`](/documentation/AVFoundation/AVURLAsset/init(URL:options:)-1t08s)

[`convenience init(URL: URL, options: [String : Any]?)`](/documentation/AVFoundation/AVURLAsset/init(URL:options:)-4zhx7)

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`Copyable`](/documentation/Swift/Copyable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSItemProviderWriting`](/documentation/Foundation/NSItemProviderWriting)

[`Escapable`](/documentation/Swift/Escapable)

[`Sendable`](/documentation/Swift/Sendable)

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

[`NSItemProviderReading`](/documentation/Foundation/NSItemProviderReading)

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

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherited By

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

### Inherits From

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

---

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)