tencent cloud

Video on Demand

릴리스 노트 및 공지 사항
릴리스 노트
제품 소개
제품 개요
Product Features
제품 기능
제품 장점
시나리오
솔루션
구매 가이드
과금 개요
과금 방식
구매 가이드
청구서 조회
연장 안내
연체 안내
환불 안내
시작하기
콘솔 가이드
콘솔 소개
서비스 개요
애플리케이션 관리
미디어 관리
리소스 패키지 관리
License Management
사례 튜토리얼
미디어 업로드
VOD 미디어 파일을 스마트 콜드 스토리지하는 방법
비디오 처리
배포 및 재생
이벤트 알림 수신 방법
원본 서버 마이그레이션 방법
라이브 방송 녹화
사용자 지정 Origin-pull을 수행하는 방법
라이브 방송 하이라이트 클리핑을 VOD에 통합하기 위한 가이드
EdgeOne을 사용하여 VOD 콘텐츠 배포하는 방법
개발 가이드
미디어 업로드
미디어 처리
비디오 AI
이벤트 알림
비디오 재생
미디어 파일 다운로드
서브 애플리케이션 시스템
오류 코드
플레이어 SDK 문서
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
FAQs
모바일 재생
요금
비디오 업로드
비디오 배포
비디오 재생
Web 재생
전체 화면 재생
데이터 통계
액세스 관리
미디어 자산 콜드 스토리지
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.


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백