tencent cloud

Video on Demand

動向とお知らせ
製品アップデート情報
製品紹介
製品概要
Product Features
製品の機能
製品の強み
ユースケース
ソリューション
購入ガイド
課金概要
課金方式
購入ガイドライン
請求書の照会
支払い更新の説明
支払い延滞の説明
返金説明
クイックスタート
コンソールガイド
コンソールの説明
サービスの概要
アプリケーション管理
メディア管理
リソースパック管理
License Management
プラクティスチュートリアル
メディアのアップロード
オンデマンドメディアファイルのインテリジェントコールド化方法
ビデオ処理
配信と再生
イベント通知の受信方法
オリジンサーバーのマイグレーションツール
Live Recording
カスタムオリジンサーバーback-to-originの方法
ライブストリーミングハイライトクリップを VOD に永続化するためのガイド
EdgeOne を使用して VOD コンテンツを配信する方法
開発ガイド
メディアアップロード
メディア加工処理
ビデオAI
イベント通知
ビデオ再生
メディアファイルのダウンロード
サブアプリケーションシステム
エラーコード
Player+ドキュメント
Overview
Basic Concepts
Features
Free Demo
Free Trial License
Purchase Guide
SDK Download
Licenses
Player Guide
Integration (UI Included)
Integration (No UI)
Advanced Features
API Documentation
Player Adapter
Player SDK Policy
よくあるご質問
モバイル端末再生に関するご質問
料金
ビデオのアップロード
ビデオの公開
ビデオの再生
Web側の再生
全画面表示再生
データ統計
CAM関連
メディア資産冷却に関する質問
Agreements
Service Level Agreement
VOD ポリシー
プライバシーポリシー
データ処理とセキュリティ契約
お問い合わせ
用語集

TXVodDownloadManager

PDF
フォーカスモード
フォントサイズ
最終更新日: 2025-05-30 14:55:49

TXDownloadError

Download Error Code.
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.

TXVodDownloadManager API Introduction

on-demand video player download API class
Video download supports downloading MP4 and HLS videos, corresponds to nested HLS videos, requires specifying preferred resolution (preferredResolution)

API Overview

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.
headers
Set the HTTP request header for downloading.
delegate
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.

API Detail

shareInstance

Retrieve the TXVodDownloadManager instance object in singleton mode.
+ (TXVodDownloadManager *)shareInstance;

setDownloadPath:

Set the root directory for downloading files. The download directory set here takes precedence over the one set via [TXPlayerGlobalSetting setCacheFolderPath:].
- (void)setDownloadPath:(NSString *)path;

startDownload:

Start the download using the Tencent Cloud Video fileId method.
- (TXVodDownloadMediaInfo *)startDownload:(TXVodDownloadDataSource *)source;
Parameter Description
Parameter Name
Type
Description
source
Download a resource object.

startDownload:url:

Start the download using the URL method.
- (TXVodDownloadMediaInfo *)startDownload:(NSString *)username url:(NSString *)url;
Parameter Description
Parameter Name
Type
Description
url
NSString
Download address, required.
username
NSString
Account name, optional parameter, defaults to "default" if not provided.
Return Value
Video information and download status, see TXVodDownloadMediaInfo for details.

startDownloadUrl:resolution:userName:

Start the download using the URL method.
- (TXVodDownloadMediaInfo *)startDownloadUrl:(NSString *)url resolution:(long)resolution userName:(NSString *)username;
Parameter Description
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.
Return Value
Video information and download status, see TXVodDownloadMediaInfo for details.

startDownloadDrm:resolution:userName:

Download a DRM video.
- (TXVodDownloadMediaInfo *)startDownloadDrm:(TXPlayerDrmBuilder *)drmBuilder resolution:(long)resolution userName:(NSString *)username;
Parameter Description
Parameter Name
Type
Description
drmBuilder
TXPlayerDrmBuilder
Download DRM object, refer to 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.
Return Value
Video information and download status, see TXVodDownloadMediaInfo for details.

stopDownload:

Stop download, stopped successfully when -[id<TXVodDownloadDelegate> onDownloadStop:] callback is triggered.
- (void)stopDownload:(TXVodDownloadMediaInfo *)media;
Parameter Description
Parameter Name
Type
Description
downloadMediaInfo
Download video information.

deleteDownloadMediaInfo:

Delete download information.
- (BOOL)deleteDownloadMediaInfo:(TXVodDownloadMediaInfo *)downloadMediaInfo;
Parameter Description
Parameter Name
Type
Description
downloadMediaInfo
Download video information.
Return Value
Whether the deletion is successful. YES: Successfully deleted; NO: Deletion failed. Files being downloaded cannot be deleted.

getDownloadMediaInfoList

Retrieve download list information for all users.
- (NSArray<TXVodDownloadMediaInfo *> *)getDownloadMediaInfoList;
Return Value
Video download information list: NSArray<TXVodDownloadMediaInfo>.

getDownloadMediaInfo:fileId:qualityId:userName:

Retrieve download information.
Call this API to ensure that a download task has been created earlier via startDownload:, startDownload:url:, or startDownloadDrm:resolution:userName:.
- (TXVodDownloadMediaInfo *)getDownloadMediaInfo:(int)appId fileId:(NSString *)fileId qualityId:(int)qualityId userName:(NSString *)userName;
Parameter Description
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
Video quality Id, refer to the constant TXVodQuality.
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 "".
Return Value
Video download information TXVodDownloadMediaInfo.

getDownloadMediaInfo:resolution:userName:

Retrieve download information.
- (TXVodDownloadMediaInfo *)getDownloadMediaInfo:(NSString *)url resolution:(long)preferredResolution userName:(NSString *)userName;
Parameter Description
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.
Return Value
Video download information TXVodDownloadMediaInfo.

encryptHexStringHls:

Encrypt.

+ (NSString *)encryptHexStringHls:(NSString *)originHexStr
Parameter Name
Type
Description
originHexStr
NSString
Initial hexadecimal string.
Return Value
Encrypted string: NSString

headers

Set the http request header.

@property(nonatomic, strong) NSDictionary *headers;
Parameter Name
Type
Description
headers
NSDictionary
http request header.

delegate

Set the download task callback object.

@property(nonatomic, weak) id<TXVodDownloadDelegate> delegate;
Parameter Name
Type
Description
delegate
Download task callback object.

supportPrivateEncryptMode

Set whether private encryption mode is supported (set to NO for system player, YES for custom player). Default is YES.

@property(nonatomic, assign) BOOL supportPrivateEncryptMode;
Parameter Name
Type
Description
supportPrivateEncryptMode
BOOL
Whether private encryption mode is supported.


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック