AVAssetDownloadDelegate

Trait AVAssetDownloadDelegate 

Source
pub unsafe trait AVAssetDownloadDelegate:
    NSURLSessionTaskDelegate
    + Send
    + Sync {
    // Provided methods
    unsafe fn URLSession_assetDownloadTask_didFinishDownloadingToURL(
        &self,
        session: &NSURLSession,
        asset_download_task: &AVAssetDownloadTask,
        location: &NSURL,
    )
       where Self: Sized + Message { ... }
    unsafe fn URLSession_assetDownloadTask_didLoadTimeRange_totalTimeRangesLoaded_timeRangeExpectedToLoad(
        &self,
        session: &NSURLSession,
        asset_download_task: &AVAssetDownloadTask,
        time_range: CMTimeRange,
        loaded_time_ranges: &NSArray<NSValue>,
        time_range_expected_to_load: CMTimeRange,
    )
       where Self: Sized + Message { ... }
    unsafe fn URLSession_assetDownloadTask_didResolveMediaSelection(
        &self,
        session: &NSURLSession,
        asset_download_task: &AVAssetDownloadTask,
        resolved_media_selection: &AVMediaSelection,
    )
       where Self: Sized + Message { ... }
    unsafe fn URLSession_assetDownloadTask_willDownloadToURL(
        &self,
        session: &NSURLSession,
        asset_download_task: &AVAssetDownloadTask,
        location: &NSURL,
    )
       where Self: Sized + Message { ... }
    unsafe fn URLSession_aggregateAssetDownloadTask_willDownloadToURL(
        &self,
        session: &NSURLSession,
        aggregate_asset_download_task: &AVAggregateAssetDownloadTask,
        location: &NSURL,
    )
       where Self: Sized + Message { ... }
    unsafe fn URLSession_aggregateAssetDownloadTask_didCompleteForMediaSelection(
        &self,
        session: &NSURLSession,
        aggregate_asset_download_task: &AVAggregateAssetDownloadTask,
        media_selection: &AVMediaSelection,
    )
       where Self: Sized + Message { ... }
    unsafe fn URLSession_aggregateAssetDownloadTask_didLoadTimeRange_totalTimeRangesLoaded_timeRangeExpectedToLoad_forMediaSelection(
        &self,
        session: &NSURLSession,
        aggregate_asset_download_task: &AVAggregateAssetDownloadTask,
        time_range: CMTimeRange,
        loaded_time_ranges: &NSArray<NSValue>,
        time_range_expected_to_load: CMTimeRange,
        media_selection: &AVMediaSelection,
    )
       where Self: Sized + Message { ... }
    unsafe fn URLSession_assetDownloadTask_willDownloadVariants(
        &self,
        session: &NSURLSession,
        asset_download_task: &AVAssetDownloadTask,
        variants: &NSArray<AVAssetVariant>,
    )
       where Self: Sized + Message { ... }
    unsafe fn URLSession_assetDownloadTask_didReceiveMetricEvent(
        &self,
        session: &NSURLSession,
        asset_download_task: &AVAssetDownloadTask,
        metric_event: &AVMetricEvent,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature AVAssetDownloadTask only.
Expand description

Delegate methods to implement when adopting AVAssetDownloadTask. Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn URLSession_assetDownloadTask_didFinishDownloadingToURL( &self, session: &NSURLSession, asset_download_task: &AVAssetDownloadTask, location: &NSURL, )
where Self: Sized + Message,

👎Deprecated: Use URLSession:assetDownloadTask:willDownloadToURL: instead

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.

  • Parameter session: The session the asset download task is on.
  • Parameter assetDownloadTask: The AVAssetDownloadTask whose downloaded completed.
  • Parameter location: The location the asset has been downloaded to.
Source

unsafe fn URLSession_assetDownloadTask_didLoadTimeRange_totalTimeRangesLoaded_timeRangeExpectedToLoad( &self, session: &NSURLSession, asset_download_task: &AVAssetDownloadTask, time_range: CMTimeRange, loaded_time_ranges: &NSArray<NSValue>, time_range_expected_to_load: CMTimeRange, )
where Self: Sized + Message,

👎Deprecated: Use NSURLSessionTask.progress instead
Available on crate feature objc2-core-media only.

Method to adopt to subscribe to progress updates of an AVAssetDownloadTask.

  • Parameter session: The session the asset download task is on.
  • Parameter assetDownloadTask: The AVAssetDownloadTask which is being updated.
  • Parameter timeRange: A CMTimeRange indicating the time range loaded since the last time this method was called.
  • Parameter loadedTimeRanges: A NSArray of NSValues of CMTimeRanges indicating all the time ranges loaded by this asset download task.
  • Parameter timeRangeExpectedToLoad: A CMTimeRange indicating the single time range that is expected to be loaded when the download is complete.
Source

unsafe fn URLSession_assetDownloadTask_didResolveMediaSelection( &self, session: &NSURLSession, asset_download_task: &AVAssetDownloadTask, resolved_media_selection: &AVMediaSelection, )
where Self: Sized + Message,

Available on crate feature AVMediaSelection only.

Method called when the media selection for the download is fully resolved, including any automatic selections.

  • Parameter session: The session the asset download task is on.
  • Parameter assetDownloadTask: The AVAssetDownloadTask which is being updated.
  • Parameter 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.
Source

unsafe fn URLSession_assetDownloadTask_willDownloadToURL( &self, session: &NSURLSession, asset_download_task: &AVAssetDownloadTask, location: &NSURL, )
where Self: Sized + Message,

Method called when the asset 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.

  • Parameter session: The session the asset download task is on.
  • Parameter assetDownloadTask: The AVAssetDownloadTask.
  • Parameter location: The file URL this task will download media data to.
Source

unsafe fn URLSession_aggregateAssetDownloadTask_willDownloadToURL( &self, session: &NSURLSession, aggregate_asset_download_task: &AVAggregateAssetDownloadTask, location: &NSURL, )
where Self: Sized + Message,

👎Deprecated: Use URLSession:assetDownloadTask:willDownloadToURL: instead

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.

  • Parameter session: The session the aggregate asset download task is on.
  • Parameter aggregateAssetDownloadTask: The AVAggregateAssetDownloadTask.
  • Parameter location: The file URL this task will download media data to.
Source

unsafe fn URLSession_aggregateAssetDownloadTask_didCompleteForMediaSelection( &self, session: &NSURLSession, aggregate_asset_download_task: &AVAggregateAssetDownloadTask, media_selection: &AVMediaSelection, )
where Self: Sized + Message,

👎Deprecated: Use the NSURLSessionDownloadDelegate method instead, URLSession:task:didCompleteWithError:
Available on crate feature AVMediaSelection only.

Method called when a child AVAssetDownloadTask completes.

  • Parameter session: The session the aggregate asset download task is on.
  • Parameter aggregateAssetDownloadTask: The AVAggregateAssetDownloadTask.
  • Parameter mediaSelection: The AVMediaSelection which is now fully available for offline use.
Source

unsafe fn URLSession_aggregateAssetDownloadTask_didLoadTimeRange_totalTimeRangesLoaded_timeRangeExpectedToLoad_forMediaSelection( &self, session: &NSURLSession, aggregate_asset_download_task: &AVAggregateAssetDownloadTask, time_range: CMTimeRange, loaded_time_ranges: &NSArray<NSValue>, time_range_expected_to_load: CMTimeRange, media_selection: &AVMediaSelection, )
where Self: Sized + Message,

👎Deprecated: Use NSURLSessionTask.progress: instead
Available on crate features AVMediaSelection and objc2-core-media only.

Method to adopt to subscribe to progress updates of an AVAggregateAssetDownloadTask

  • Parameter session: The session the asset download task is on.
  • Parameter aggregateAssetDownloadTask: The AVAggregateAssetDownloadTask.
  • Parameter timeRange: A CMTimeRange indicating the time range loaded for the media selection being downloaded.
  • Parameter loadedTimeRanges: A NSArray of NSValues of CMTimeRanges indicating all the time ranges loaded for the media selection being downloaded.
  • Parameter 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.
  • Parameter mediaSelection: The media selection which has additional media data loaded for offline use.
Source

unsafe fn URLSession_assetDownloadTask_willDownloadVariants( &self, session: &NSURLSession, asset_download_task: &AVAssetDownloadTask, variants: &NSArray<AVAssetVariant>, )
where Self: Sized + Message,

Available on crate feature AVAssetVariant only.

Sent when a download task has completed the variant selection.

  • Parameter session: The session the asset download task is on.
  • Parameter assetDownloadTask: The asset download task.
  • Parameter variants: The variants chosen. Depends on the environmental condition when the download starts.
Source

unsafe fn URLSession_assetDownloadTask_didReceiveMetricEvent( &self, session: &NSURLSession, asset_download_task: &AVAssetDownloadTask, metric_event: &AVMetricEvent, )
where Self: Sized + Message,

Available on crate feature AVMetrics only.

Sent when a download task receives an AVMetricEvent.

  • Parameter session: The NSURLSession corresponding to this AVAssetDownloadTask.
  • Parameter assetDownloadTask: The asset download task.
  • Parameter metricEvent: The metric event received.

Trait Implementations§

Source§

impl ProtocolType for dyn AVAssetDownloadDelegate

Source§

const NAME: &'static str = "AVAssetDownloadDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn AVAssetDownloadDelegate

Implementations on Foreign Types§

Source§

impl<T> AVAssetDownloadDelegate for ProtocolObject<T>

Implementors§