Value | Parameter Name | Description |
0 | TXDownloadSuccess | Download success. |
-5001 | TXDownloadAuthFaild | File ID authentication failure. |
-5003 | TXDownloadNoFile | No file with this resolution. |
-5004 | TXDownloadFormatError | Unsupported format. |
-5005 | TXDownloadDisconnet | Network disconnection. |
-5006 | TXDownloadHlsKeyError | Failed to retrieve the HLS decryption key. |
-5007 | TXDownloadPathError | Download directory access failure. |
-5008 | TXDownload403Forbidden | Authentication information not approved, such as signature expiration or invalid request. |
API | Description |
Retrieve the TXVodDownloadManager instance object in singleton mode. | |
Set the root directory for downloading files. If it does not exist, it will be automatically created. | |
Start the download using the URL method. | |
Start the download using the fileId method. | |
Start the download using the URL method, and specify the preferred clarity and account name. | |
Start the download using the Drm method. | |
Stop download, stopped successfully when [TXVodDownloadDelegate onDownloadStop:] callback is triggered. | |
Delete download information. | |
Delete files generated during download. | |
Retrieve download list information for all users, time-consuming API, do not call on the main thread. | |
Retrieve download information. | |
Retrieve download information. | |
Encrypt. | |
Set the HTTP request header for downloading. | |
Set the download callback proxy object. It must be configured before downloading. | |
Set whether private encryption mode is supported (set to NO for system player, YES for custom player). By default, it is set to YES. |
+ (TXVodDownloadManager *)shareInstance;
[TXPlayerGlobalSetting setCacheFolderPath:].- (void)setDownloadPath:(NSString *)path;
- (TXVodDownloadMediaInfo *)startDownload:(TXVodDownloadDataSource *)source;
Parameter Name | Type | Description |
source | Download a resource object. |
- (TXVodDownloadMediaInfo *)startDownload:(NSString *)username url:(NSString *)url;
Parameter Name | Type | Description |
url | NSString | Download address, required. |
username | NSString | Account name, optional parameter, defaults to "default" if not provided. |
- (TXVodDownloadMediaInfo *)startDownloadUrl:(NSString *)url resolution:(long)resolution userName:(NSString *)username;
Parameter Name | Type | Description |
url | NSString | Download address, required. |
resolution | long | Preference for clarity, multiple resolutions url is a required parameter, with the value being preference clarity width × height (e.g., 720p input 921600 = 1280 × 720), single clarity input -1. |
username | NSString | Account name, optional parameter, defaults to "default" if not provided. |
- (TXVodDownloadMediaInfo *)startDownloadDrm:(TXPlayerDrmBuilder *)drmBuilder resolution:(long)resolution userName:(NSString *)username;
Parameter Name | Type | Description |
drmBuilder | TXPlayerDrmBuilder | |
resolution | long | Preference clarity, multiple resolutions URL is a required parameter, with the value being preference clarity width * height (e.g., 720p input 921600 = 1280 * 720), single clarity input -1. |
username | NSString | Account name, optional parameter, defaults to "default" if not provided. |
-[id<TXVodDownloadDelegate> onDownloadStop:] callback is triggered.- (void)stopDownload:(TXVodDownloadMediaInfo *)media;
Parameter Name | Type | Description |
downloadMediaInfo | Download video information. |
- (BOOL)deleteDownloadMediaInfo:(TXVodDownloadMediaInfo *)downloadMediaInfo;
Parameter Name | Type | Description |
downloadMediaInfo | Download video information. |
- (NSArray<TXVodDownloadMediaInfo *> *)getDownloadMediaInfoList;
startDownload:, startDownload:url:, or startDownloadDrm:resolution:userName:.- (TXVodDownloadMediaInfo *)getDownloadMediaInfo:(int)appId fileId:(NSString *)fileId qualityId:(int)qualityId userName:(NSString *)userName;
Parameter Name | Type | Description |
appId | int | Tencent Cloud Video on Demand (VOD) application appId. |
fileId | NSString | Tencent Cloud Video on Demand (VOD) video fileId. |
qualityId | int | |
userName | NSString | Account name must be consistent with the account name passed in during download. If not passed in during download, pass in the empty character "". |
- (TXVodDownloadMediaInfo *)getDownloadMediaInfo:(NSString *)url resolution:(long)preferredResolution userName:(NSString *)userName;
Parameter Name | Type | Description |
url | NSString | Download address, required parameter, otherwise download fails. |
preferredResolution | long | Download preferred clarity, multiple resolutions URL is a required parameter, with the value being preferred clarity width × height (e.g., 720p input 921600 = 1280 × 720), single clarity input -1. |
userName | userName | Account name, optional parameter, defaults to "default" if not provided. |
+ (NSString *)encryptHexStringHls:(NSString *)originHexStr
Parameter Name | Type | Description |
originHexStr | NSString | Initial hexadecimal string. |
@property(nonatomic, strong) NSDictionary *headers;
Parameter Name | Type | Description |
headers | NSDictionary | http request header. |
@property(nonatomic, weak) id<TXVodDownloadDelegate> delegate;
Parameter Name | Type | Description |
delegate | Download task callback object. |
@property(nonatomic, assign) BOOL supportPrivateEncryptMode;
Parameter Name | Type | Description |
supportPrivateEncryptMode | BOOL | Whether private encryption mode is supported. |
フィードバック