Interface AVAssetDownloadDelegate

    • Method Detail

      • URLSessionAssetDownloadTaskDidFinishDownloadingToURL

        default void URLSessionAssetDownloadTaskDidFinishDownloadingToURL​(@NotNull
                                                                          @NotNull NSURLSession session,
                                                                          @NotNull
                                                                          @NotNull AVAssetDownloadTask assetDownloadTask,
                                                                          @NotNull
                                                                          @NotNull 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. API-Since: 10.0
      • URLSessionAssetDownloadTaskDidLoadTimeRangeTotalTimeRangesLoadedTimeRangeExpectedToLoad

        default void URLSessionAssetDownloadTaskDidLoadTimeRangeTotalTimeRangesLoadedTimeRangeExpectedToLoad​(@NotNull
                                                                                                             @NotNull NSURLSession session,
                                                                                                             @NotNull
                                                                                                             @NotNull AVAssetDownloadTask assetDownloadTask,
                                                                                                             CMTimeRange timeRange,
                                                                                                             @NotNull
                                                                                                             @NotNull 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. API-Since: 9.0
      • URLSessionAssetDownloadTaskDidResolveMediaSelection

        default void URLSessionAssetDownloadTaskDidResolveMediaSelection​(@NotNull
                                                                         @NotNull NSURLSession session,
                                                                         @NotNull
                                                                         @NotNull AVAssetDownloadTask assetDownloadTask,
                                                                         @NotNull
                                                                         @NotNull 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. API-Since: 9.0
      • URLSessionAggregateAssetDownloadTaskDidCompleteForMediaSelection

        default void URLSessionAggregateAssetDownloadTaskDidCompleteForMediaSelection​(@NotNull
                                                                                      @NotNull NSURLSession session,
                                                                                      @NotNull
                                                                                      @NotNull AVAggregateAssetDownloadTask aggregateAssetDownloadTask,
                                                                                      @NotNull
                                                                                      @NotNull 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. API-Since: 11.0
      • URLSessionAggregateAssetDownloadTaskDidLoadTimeRangeTotalTimeRangesLoadedTimeRangeExpectedToLoadForMediaSelection

        default void URLSessionAggregateAssetDownloadTaskDidLoadTimeRangeTotalTimeRangesLoadedTimeRangeExpectedToLoadForMediaSelection​(@NotNull
                                                                                                                                       @NotNull NSURLSession session,
                                                                                                                                       @NotNull
                                                                                                                                       @NotNull AVAggregateAssetDownloadTask aggregateAssetDownloadTask,
                                                                                                                                       CMTimeRange timeRange,
                                                                                                                                       @NotNull
                                                                                                                                       @NotNull NSArray<? extends NSValue> loadedTimeRanges,
                                                                                                                                       CMTimeRange timeRangeExpectedToLoad,
                                                                                                                                       @NotNull
                                                                                                                                       @NotNull 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. API-Since: 11.0
      • URLSessionAggregateAssetDownloadTaskWillDownloadToURL

        default void URLSessionAggregateAssetDownloadTaskWillDownloadToURL​(@NotNull
                                                                           @NotNull NSURLSession session,
                                                                           @NotNull
                                                                           @NotNull AVAggregateAssetDownloadTask aggregateAssetDownloadTask,
                                                                           @NotNull
                                                                           @NotNull 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. API-Since: 11.0
      • URLSessionAssetDownloadTaskWillDownloadVariants

        default void URLSessionAssetDownloadTaskWillDownloadVariants​(@NotNull
                                                                     @NotNull NSURLSession session,
                                                                     @NotNull
                                                                     @NotNull AVAssetDownloadTask assetDownloadTask,
                                                                     @NotNull
                                                                     @NotNull NSArray<? extends AVAssetVariant> variants)
        URLSession:assetDownloadTask:willDownloadVariants: Sent when a download task has completed the variant selection.
        Parameters:
        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. API-Since: 15.0