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 { ... }
}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§
Sourceunsafe fn URLSession_assetDownloadTask_didFinishDownloadingToURL(
&self,
session: &NSURLSession,
asset_download_task: &AVAssetDownloadTask,
location: &NSURL,
)
👎Deprecated: Use URLSession:assetDownloadTask:willDownloadToURL: instead
unsafe fn URLSession_assetDownloadTask_didFinishDownloadingToURL( &self, session: &NSURLSession, asset_download_task: &AVAssetDownloadTask, location: &NSURL, )
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.
Sourceunsafe 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,
)
👎Deprecated: Use NSURLSessionTask.progress insteadAvailable on crate feature objc2-core-media only.
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, )
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.
Sourceunsafe fn URLSession_assetDownloadTask_didResolveMediaSelection(
&self,
session: &NSURLSession,
asset_download_task: &AVAssetDownloadTask,
resolved_media_selection: &AVMediaSelection,
)
Available on crate feature AVMediaSelection only.
unsafe fn URLSession_assetDownloadTask_didResolveMediaSelection( &self, session: &NSURLSession, asset_download_task: &AVAssetDownloadTask, resolved_media_selection: &AVMediaSelection, )
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.
Sourceunsafe fn URLSession_assetDownloadTask_willDownloadToURL(
&self,
session: &NSURLSession,
asset_download_task: &AVAssetDownloadTask,
location: &NSURL,
)
unsafe fn URLSession_assetDownloadTask_willDownloadToURL( &self, session: &NSURLSession, asset_download_task: &AVAssetDownloadTask, location: &NSURL, )
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.
Sourceunsafe fn URLSession_aggregateAssetDownloadTask_willDownloadToURL(
&self,
session: &NSURLSession,
aggregate_asset_download_task: &AVAggregateAssetDownloadTask,
location: &NSURL,
)
👎Deprecated: Use URLSession:assetDownloadTask:willDownloadToURL: instead
unsafe fn URLSession_aggregateAssetDownloadTask_willDownloadToURL( &self, session: &NSURLSession, aggregate_asset_download_task: &AVAggregateAssetDownloadTask, location: &NSURL, )
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.
Sourceunsafe fn URLSession_aggregateAssetDownloadTask_didCompleteForMediaSelection(
&self,
session: &NSURLSession,
aggregate_asset_download_task: &AVAggregateAssetDownloadTask,
media_selection: &AVMediaSelection,
)
👎Deprecated: Use the NSURLSessionDownloadDelegate method instead, URLSession:task:didCompleteWithError:Available on crate feature AVMediaSelection only.
unsafe fn URLSession_aggregateAssetDownloadTask_didCompleteForMediaSelection( &self, session: &NSURLSession, aggregate_asset_download_task: &AVAggregateAssetDownloadTask, media_selection: &AVMediaSelection, )
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.
Sourceunsafe 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,
)
👎Deprecated: Use NSURLSessionTask.progress: insteadAvailable on crate features AVMediaSelection and objc2-core-media only.
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, )
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.
Sourceunsafe fn URLSession_assetDownloadTask_willDownloadVariants(
&self,
session: &NSURLSession,
asset_download_task: &AVAssetDownloadTask,
variants: &NSArray<AVAssetVariant>,
)
Available on crate feature AVAssetVariant only.
unsafe fn URLSession_assetDownloadTask_willDownloadVariants( &self, session: &NSURLSession, asset_download_task: &AVAssetDownloadTask, variants: &NSArray<AVAssetVariant>, )
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.
Sourceunsafe fn URLSession_assetDownloadTask_didReceiveMetricEvent(
&self,
session: &NSURLSession,
asset_download_task: &AVAssetDownloadTask,
metric_event: &AVMetricEvent,
)
Available on crate feature AVMetrics only.
unsafe fn URLSession_assetDownloadTask_didReceiveMetricEvent( &self, session: &NSURLSession, asset_download_task: &AVAssetDownloadTask, metric_event: &AVMetricEvent, )
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.