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

# AVAssetDownloadTask

A URL session task that downloads a remote asset to the device for offline playback.

```
class AVAssetDownloadTask
```

## Overview

You create instances of this class by calling [`makeAssetDownloadTask(downloadConfiguration:)`](/documentation/AVFoundation/AVAssetDownloadURLSession/makeAssetDownloadTask(downloadConfiguration:)) on the download session.

To play an asset while its download is in progress, reuse the [`AVURLAsset`](/documentation/AVFoundation/AVURLAsset) you supplied to the download configuration. The asset reads locally cached segments during concurrent playback when the streaming variant matches the downloading variant.

Adopt the [`AVAssetDownloadDelegate`](/documentation/AVFoundation/AVAssetDownloadDelegate) protocol to receive progress and completion callbacks. Use the inherited <doc://com.apple.documentation/documentation/Foundation/URLSessionTask/progress> property for numeric download progress updates. The delegate method [`urlSession(_:assetDownloadTask:willDownloadTo:)`](/documentation/AVFoundation/AVAssetDownloadDelegate/urlSession(_:assetDownloadTask:willDownloadTo:)) provides the local file URL where the system stores the asset.

> Important: Save the local file URL the delegate provides. You need it to reconstruct the offline ``doc://com.apple.avfoundation/documentation/AVFoundation/AVURLAsset`` on subsequent app launches.

To augment an existing download, initialize a new task with an [`AVURLAsset`](/documentation/AVFoundation/AVURLAsset) whose URL references the downloaded asset on disk. For example, you can add media selections that you didn’t include in the original download.

### Live Activity

To control how the system schedules downloads, set the `isDiscretionary` property on the <doc://com.apple.documentation/documentation/Foundation/URLSessionConfiguration> you pass when creating the [`AVAssetDownloadURLSession`](/documentation/AVFoundation/AVAssetDownloadURLSession). Non-discretionary downloads start as soon as possible. The system defers discretionary downloads until conditions like network and battery state are favorable, and runs them silently in the background.

On supported platforms, a non-discretionary download displays a Live Activity on the Lock Screen and in the Dynamic Island that shows real-time download progress. Discretionary downloads don’t display a Live Activity.

When your app has multiple active downloads, the system aggregates them into a single Live Activity that shows combined progress. For a single active download, the activity title displays the asset title.

If any downloads in the group fail, the Live Activity transitions to a failure state after all downloads finish. A person can also cancel all active and queued downloads for your app directly from the Live Activity, which causes the tasks to fail with `NSUserCancelledError` in the `NSCocoaErrorDomain` domain.

The Live Activity doesn’t reflect download tasks until you resume them. If you resume a task while your app runs in the background, the system might demote it to discretionary. The system queues downloads in the order you resume them.

Swift subclasses of this type must conform to <doc://com.apple.documentation/documentation/Swift/Sendable>.

## Topics

### Accessing task information

[`urlAsset`](/documentation/AVFoundation/AVAssetDownloadTask/urlAsset)

The asset that this task downloads.

[`loadedTimeRanges`](/documentation/AVFoundation/AVAssetDownloadTask/loadedTimeRanges)

The time ranges of the downloaded media that are ready for playback.

[`options`](/documentation/AVFoundation/AVAssetDownloadTask/options)

The configuration options for the task.

[`destinationURL`](/documentation/AVFoundation/AVAssetDownloadTask/destinationURL)

The local file URL to where the task downloads the asset.



---

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)