public interface AVAssetDownloadDelegate extends NSURLSessionTaskDelegate
Delegate methods to implement when adopting AVAssetDownloadTask.
NSURLSessionTaskDelegate.Block_URLSessionTaskDidReceiveChallengeCompletionHandler, NSURLSessionTaskDelegate.Block_URLSessionTaskNeedNewBodyStream, NSURLSessionTaskDelegate.Block_URLSessionTaskWillBeginDelayedRequestCompletionHandler, NSURLSessionTaskDelegate.Block_URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandlerNSURLSessionDelegate.Block_URLSessionDidReceiveChallengeCompletionHandler| Modifier and Type | Method and Description |
|---|---|
default void |
URLSessionAggregateAssetDownloadTaskDidCompleteForMediaSelection(NSURLSession session,
AVAggregateAssetDownloadTask aggregateAssetDownloadTask,
AVMediaSelection mediaSelection)
URLSession:aggregateAssetDownloadTask:didCompleteForMediaSelection:
|
default void |
URLSessionAggregateAssetDownloadTaskDidLoadTimeRangeTotalTimeRangesLoadedTimeRangeExpectedToLoadForMediaSelection(NSURLSession session,
AVAggregateAssetDownloadTask aggregateAssetDownloadTask,
CMTimeRange timeRange,
NSArray<? extends NSValue> loadedTimeRanges,
CMTimeRange timeRangeExpectedToLoad,
AVMediaSelection mediaSelection)
URLSession:aggregateAssetDownloadTask:didLoadTimeRange:totalTimeRangesLoaded:timeRangeExpectedToLoad:forMediaSelection:
|
default void |
URLSessionAggregateAssetDownloadTaskWillDownloadToURL(NSURLSession session,
AVAggregateAssetDownloadTask aggregateAssetDownloadTask,
NSURL location)
URLSession:aggregateAssetDownloadTask:willDownloadToURL:
|
default void |
URLSessionAssetDownloadTaskDidFinishDownloadingToURL(NSURLSession session,
AVAssetDownloadTask assetDownloadTask,
NSURL location)
URLSession:assetDownloadTask:didFinishDownloadingToURL:
|
default void |
URLSessionAssetDownloadTaskDidLoadTimeRangeTotalTimeRangesLoadedTimeRangeExpectedToLoad(NSURLSession session,
AVAssetDownloadTask assetDownloadTask,
CMTimeRange timeRange,
NSArray<? extends NSValue> loadedTimeRanges,
CMTimeRange timeRangeExpectedToLoad)
URLSession:assetDownloadTask:didLoadTimeRange:totalTimeRangesLoaded:timeRangeExpectedToLoad:
|
default void |
URLSessionAssetDownloadTaskDidResolveMediaSelection(NSURLSession session,
AVAssetDownloadTask assetDownloadTask,
AVMediaSelection resolvedMediaSelection)
URLSession:assetDownloadTask:didResolveMediaSelection:
|
default void |
URLSessionAssetDownloadTaskWillDownloadVariants(NSURLSession session,
AVAssetDownloadTask assetDownloadTask,
NSArray<? extends AVAssetVariant> variants)
URLSession:assetDownloadTask:willDownloadVariants:
|
URLSessionTaskDidCompleteWithError, URLSessionTaskDidFinishCollectingMetrics, URLSessionTaskDidReceiveChallengeCompletionHandler, URLSessionTaskDidSendBodyDataTotalBytesSentTotalBytesExpectedToSend, URLSessionTaskIsWaitingForConnectivity, URLSessionTaskNeedNewBodyStream, URLSessionTaskWillBeginDelayedRequestCompletionHandler, URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandlerURLSessionDidBecomeInvalidWithError, URLSessionDidFinishEventsForBackgroundURLSession, URLSessionDidReceiveChallengeCompletionHandlerdefault void URLSessionAssetDownloadTaskDidFinishDownloadingToURL(NSURLSession session, AVAssetDownloadTask assetDownloadTask, NSURL location)
Sent when a download task that has completed a download.
Unlike NSURLSessionDownloadDelegate, the delegate should NOT move the file from this directory after it has been called. Downloaded assets must remain at the system provided URL. URLSession:task:didCompleteWithError: will still be called.
session - The session the asset download task is on.assetDownloadTask - The AVAssetDownloadTask whose downloaded completed.location - The location the asset has been downloaded to.default void URLSessionAssetDownloadTaskDidLoadTimeRangeTotalTimeRangesLoadedTimeRangeExpectedToLoad(NSURLSession session, AVAssetDownloadTask assetDownloadTask, CMTimeRange timeRange, NSArray<? extends NSValue> loadedTimeRanges, CMTimeRange timeRangeExpectedToLoad)
Method to adopt to subscribe to progress updates of an AVAssetDownloadTask.
session - The session the asset download task is on.assetDownloadTask - The AVAssetDownloadTask which is being updated.timeRange - A CMTimeRange indicating the time range loaded since the last time this method was called.loadedTimeRanges - A NSArray of NSValues of CMTimeRanges indicating all the time ranges loaded by this asset download task.timeRangeExpectedToLoad - A CMTimeRange indicating the single time range that is expected to be loaded when the download is complete.default void URLSessionAssetDownloadTaskDidResolveMediaSelection(NSURLSession session, AVAssetDownloadTask assetDownloadTask, AVMediaSelection resolvedMediaSelection)
Method called when the media selection for the download is fully resolved, including any automatic selections.
session - The session the asset download task is on.assetDownloadTask - The AVAssetDownloadTask which is being updated.resolvedMediaSelection - The resolved media selection for the download task. For the best chance of playing back downloaded content without further network I/O, apply this selection to subsequent AVPlayerItems.default void URLSessionAggregateAssetDownloadTaskDidCompleteForMediaSelection(NSURLSession session, AVAggregateAssetDownloadTask aggregateAssetDownloadTask, AVMediaSelection mediaSelection)
Method called when a child AVAssetDownloadTask completes.
session - The session the aggregate asset download task is on.aggregateAssetDownloadTask - The AVAggregateAssetDownloadTask.mediaSelection - The AVMediaSelection which is now fully available for offline use.default void URLSessionAggregateAssetDownloadTaskDidLoadTimeRangeTotalTimeRangesLoadedTimeRangeExpectedToLoadForMediaSelection(NSURLSession session, AVAggregateAssetDownloadTask aggregateAssetDownloadTask, CMTimeRange timeRange, NSArray<? extends NSValue> loadedTimeRanges, CMTimeRange timeRangeExpectedToLoad, AVMediaSelection mediaSelection)
Method to adopt to subscribe to progress updates of an AVAggregateAssetDownloadTask
session - The session the asset download task is on.aggregateAssetDownloadTask - The AVAggregateAssetDownloadTask.timeRange - A CMTimeRange indicating the time range loaded for the media selection being downloaded.loadedTimeRanges - A NSArray of NSValues of CMTimeRanges indicating all the time ranges loaded for the media selection being downloaded.timeRangeExpectedToLoad - A CMTimeRange indicating the single time range that is expected to be loaded when the download is complete for the media selection being downloaded.mediaSelection - The media selection which has additional media data loaded for offline use.default void URLSessionAggregateAssetDownloadTaskWillDownloadToURL(NSURLSession session, AVAggregateAssetDownloadTask aggregateAssetDownloadTask, NSURL location)
Method called when the aggregate download task determines the location this asset will be downloaded to.
This URL should be saved for future instantiations of AVAsset. While an AVAsset already exists for this content, it is advisable to re-use that instance.
session - The session the aggregate asset download task is on.aggregateAssetDownloadTask - The AVAggregateAssetDownloadTask.location - The file URL this task will download media data to.default void URLSessionAssetDownloadTaskWillDownloadVariants(NSURLSession session, AVAssetDownloadTask assetDownloadTask, NSArray<? extends AVAssetVariant> variants)
Sent when a download task has completed the variant selection.
session - The session the asset download task is on.assetDownloadTask - The asset download task.variants - The variants chosen. Depends on the environmental condition when the download starts.