Interface AVAssetDownloadDelegate

    • Method Detail

      • URLSessionAssetDownloadTaskDidFinishDownloadingToURL

        default void URLSessionAssetDownloadTaskDidFinishDownloadingToURL​(NSURLSession session,
                                                                          AVAssetDownloadTask assetDownloadTask,
                                                                          NSURL location)
        URLSession:assetDownloadTask:didFinishDownloadingToURL: 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.
        Parameters:
        session - The session the asset download task is on.
        assetDownloadTask - The AVAssetDownloadTask whose downloaded completed.
        location - The location the asset has been downloaded to.
      • URLSessionAssetDownloadTaskDidLoadTimeRangeTotalTimeRangesLoadedTimeRangeExpectedToLoad

        default void URLSessionAssetDownloadTaskDidLoadTimeRangeTotalTimeRangesLoadedTimeRangeExpectedToLoad​(NSURLSession session,
                                                                                                             AVAssetDownloadTask assetDownloadTask,
                                                                                                             CMTimeRange timeRange,
                                                                                                             NSArray<? extends NSValue> loadedTimeRanges,
                                                                                                             CMTimeRange timeRangeExpectedToLoad)
        URLSession:assetDownloadTask:didLoadTimeRange:totalTimeRangesLoaded:timeRangeExpectedToLoad: Method to adopt to subscribe to progress updates of an AVAssetDownloadTask.
        Parameters:
        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.
      • URLSessionAssetDownloadTaskDidResolveMediaSelection

        default void URLSessionAssetDownloadTaskDidResolveMediaSelection​(NSURLSession session,
                                                                         AVAssetDownloadTask assetDownloadTask,
                                                                         AVMediaSelection resolvedMediaSelection)
        URLSession:assetDownloadTask:didResolveMediaSelection: Method called when the media selection for the download is fully resolved, including any automatic selections.
        Parameters:
        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.
      • URLSessionAggregateAssetDownloadTaskDidCompleteForMediaSelection

        default void URLSessionAggregateAssetDownloadTaskDidCompleteForMediaSelection​(NSURLSession session,
                                                                                      AVAggregateAssetDownloadTask aggregateAssetDownloadTask,
                                                                                      AVMediaSelection mediaSelection)
        URLSession:aggregateAssetDownloadTask:didCompleteForMediaSelection: Method called when a child AVAssetDownloadTask completes.
        Parameters:
        session - The session the aggregate asset download task is on.
        aggregateAssetDownloadTask - The AVAggregateAssetDownloadTask.
        mediaSelection - The AVMediaSelection which is now fully available for offline use.
      • URLSessionAggregateAssetDownloadTaskDidLoadTimeRangeTotalTimeRangesLoadedTimeRangeExpectedToLoadForMediaSelection

        default void URLSessionAggregateAssetDownloadTaskDidLoadTimeRangeTotalTimeRangesLoadedTimeRangeExpectedToLoadForMediaSelection​(NSURLSession session,
                                                                                                                                       AVAggregateAssetDownloadTask aggregateAssetDownloadTask,
                                                                                                                                       CMTimeRange timeRange,
                                                                                                                                       NSArray<? extends NSValue> loadedTimeRanges,
                                                                                                                                       CMTimeRange timeRangeExpectedToLoad,
                                                                                                                                       AVMediaSelection mediaSelection)
        URLSession:aggregateAssetDownloadTask:didLoadTimeRange:totalTimeRangesLoaded:timeRangeExpectedToLoad:forMediaSelection: Method to adopt to subscribe to progress updates of an AVAggregateAssetDownloadTask
        Parameters:
        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.
      • URLSessionAggregateAssetDownloadTaskWillDownloadToURL

        default void URLSessionAggregateAssetDownloadTaskWillDownloadToURL​(NSURLSession session,
                                                                           AVAggregateAssetDownloadTask aggregateAssetDownloadTask,
                                                                           NSURL location)
        URLSession:aggregateAssetDownloadTask:willDownloadToURL: 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.
        Parameters:
        session - The session the aggregate asset download task is on.
        aggregateAssetDownloadTask - The AVAggregateAssetDownloadTask.
        location - The file URL this task will download media data to.