![]() |
AliyunPlayer v7.10.0
Aliyun Player API Reference Manual for iOS Platforms
|
Media file preloader class. More...
#include "AliMediaLoader.h"
Instance Methods | |
| (void) | - cancel: |
| Cancels loading. | |
| (void) | - load:duration: |
| Starts loading a file. | |
| (void) | - load:duration:defaultBandWidth: |
| Starts loading a file, specifying the default bitrate. | |
| (void) | - load:duration:defaultResolutionProduct: |
| Starts loading a file, specifying the default resolution. | |
| (void) | - pause: |
| Pauses loading. | |
| (void) | - resume: |
| Resumes loading. | |
| (void) | - setAliMediaLoaderStatusDelegate: |
| Sets the status delegate. | |
Class Methods | |
| (instancetype) | + shareInstance |
| Gets the singleton instance of AliMediaLoader. | |
Media file preloader class.
Provides functionality to preload, cancel, pause, and resume media files. This is a singleton class.
| - (void) cancel: | (NSString *) | url |
Cancels loading.
| url | The URL of the video file to cancel loading. If nil or an empty string, all ongoing loading tasks will be canceled. |
| - (void) load: | (NSString *) | url | |
| duration: | (int64_t) | duration |
Starts loading a file.
This is an asynchronous operation, and multiple files can be loaded simultaneously. For multi-bitrate streams, this method defaults to loading the lowest bitrate stream.
| url | The URL of the video file to be loaded. |
| duration | The duration to load, in milliseconds. |
| - (void) load: | (NSString *) | url | |
| duration: | (int64_t) | duration | |
| defaultBandWidth: | (int) | defaultBandWidth |
Starts loading a file, specifying the default bitrate.
This is an asynchronous operation, and multiple files can be loaded simultaneously. When loading a multi-bitrate stream, the stream with the bitrate closest to the specified value will be selected.
| url | The URL of the video file to be loaded. |
| duration | The duration to load, in milliseconds. |
| defaultBandWidth | The default bitrate specified for loading a multi-bitrate stream, in bps (bits per second). The SDK will select the bitrate stream closest to this value. |
| - (void) load: | (NSString *) | url | |
| duration: | (int64_t) | duration | |
| defaultResolutionProduct: | (int64_t) | defaultResolutionProduct |
Starts loading a file, specifying the default resolution.
This is an asynchronous operation, and multiple files can be loaded simultaneously. When loading a multi-bitrate stream, the stream with the resolution closest to the specified value will be selected. For example, if the value 1920 * 1080 = 2073600 is provided, the stream with the resolution closest to 1920x1080 will be preloaded.
| url | The URL of the video file to be loaded. |
| duration | The duration to load, in milliseconds. |
| defaultResolutionProduct | The product of the width and height of the desired resolution, used to select the closest resolution stream. |
| - (void) pause: | (NSString *) | url |
Pauses loading.
| url | The URL of the video file to pause loading. If nil or an empty string, all ongoing loading tasks will be paused. |
| - (void) resume: | (NSString *) | url |
Resumes loading.
| url | The URL of the video file to resume loading. If nil or an empty string, all paused loading tasks will be resumed. |
| - (void) setAliMediaLoaderStatusDelegate: | (id< AliMediaLoaderStatusDelegate >) | delegate |
Sets the status delegate.
By setting a delegate, you can listen for events such as errors, completion, and cancellation during the loading process.
| delegate | An object that conforms to the AliMediaLoaderStatusDelegate protocol. |
| + (instancetype) shareInstance |
Gets the singleton instance of AliMediaLoader.