![]() |
AliyunPlayer v7.10.0
Aliyun Player API Reference Manual for iOS Platforms
|
Media file downloader class. More...
#include "AliMediaDownloader.h"
Instance Methods | |
| (void) | - deleteFile |
| Deletes the downloaded file associated with the current downloader instance. | |
| (void) | - destroy |
| Destroys the downloader instance. | |
| (AVDConfig *) | - getConfig |
| Gets the current download configuration. | |
| (instancetype) | - init |
| Initializes a downloader instance. | |
| (void) | - prepareWithPlayAuth: |
| Prepares for download using AVPVidAuthSource. | |
| (void) | - prepareWithVid: |
| Prepares for download using AVPVidStsSource. | |
| (void) | - selectTrack: |
| Selects the media track to be downloaded. | |
| (void) | - setConfig: |
| Sets the download configuration. | |
| (void) | - setPlayUrlConvertCallback: |
| Sets a callback function for converting playback URLs. | |
| (void) | - setSaveDirectory: |
| Sets the save directory for downloaded files. | |
| (void) | - start |
| Start downloading. | |
| (void) | - stop |
| Stop downloading. | |
| (void) | - updateWithPlayAuth: |
| Updates the VidAuthSource information. | |
| (void) | - updateWithVid: |
| Updates the VidStsSource information. | |
Class Methods | |
| (int) | + deleteFile:vid:format:index: |
| Deletes a downloaded file (class method). | |
| (NSString *) | + getSDKVersion |
| Gets the SDK version number. | |
Properties | |
| id< AMDDelegate > | delegate |
| Sets the delegate for download events. | |
| NSString * | downloadedFilePath |
| Gets the path of the downloaded file. | |
Media file downloader class.
This class provides functionalities for downloading media files, including preparing, starting, stopping, updating credentials, and deleting. The status during the download process is reported via the AMDDelegate protocol.
| - (void) deleteFile |
Deletes the downloaded file associated with the current downloader instance.
| + (int) deleteFile: | (NSString *) | saveDir | |
| vid: | (NSString *) | vid | |
| format: | (NSString *) | format | |
| index: | (int) | index |
Deletes a downloaded file (class method).
| saveDir | The directory path where the file is saved. |
| vid | The VID of the media file. |
| format | The format of the media file. |
| index | The download index corresponding to the VID. |
| - (void) destroy |
Destroys the downloader instance.
Call this method to release resources held by the downloader.
| - (AVDConfig *) getConfig |
Gets the current download configuration.
| + (NSString *) getSDKVersion |
Gets the SDK version number.
| - (instancetype) init |
Initializes a downloader instance.
| - (void) prepareWithPlayAuth: | (AVPVidAuthSource *) | source |
Prepares for download using AVPVidAuthSource.
This is an asynchronous operation. Upon successful preparation, the onPrepared:mediaInfo:] callback will be triggered.
| source | The AVPVidAuthSource object, containing the VID and PlayAuth credential information required for download. |
| - (void) prepareWithVid: | (AVPVidStsSource *) | source |
Prepares for download using AVPVidStsSource.
This is an asynchronous operation. Upon successful preparation, the onPrepared:mediaInfo:] callback will be triggered.
| source | The AVPVidStsSource object, containing the VID and STS credential information required for download. |
| - (void) selectTrack: | (int) | trackIndex |
Selects the media track to be downloaded.
| trackIndex | The index of the track to be downloaded. |
| - (void) setConfig: | (AVDConfig *) | config |
Sets the download configuration.
| config | An AVDConfig object containing download-related configurations. |
| - (void) setPlayUrlConvertCallback: | (PlayURLConverCallback) | callback |
Sets a callback function for converting playback URLs.
| callback | A callback function pointer. Its specific signature (parameters and return value) is not defined in this file; please refer to its source definition. |
| - (void) setSaveDirectory: | (NSString *) | dir |
Sets the save directory for downloaded files.
| dir | The folder path to save the downloaded files. |
| - (void) start |
Start downloading.
| - (void) stop |
Stop downloading.
| - (void) updateWithPlayAuth: | (AVPVidAuthSource *) | source |
Updates the VidAuthSource information.
When the PlayAuth credential expires, call this method to update the credential information.
| source | A new AVPVidAuthSource object containing the updated PlayAuth credential. |
| - (void) updateWithVid: | (AVPVidStsSource *) | source |
Updates the VidStsSource information.
When the STS credential expires, call this method to update the credential information.
| source | A new AVPVidStsSource object containing the updated STS credentials. |
|
readwritenonatomicweak |
Sets the delegate for download events.
|
readnonatomicassign |
Gets the path of the downloaded file.