tencent cloud

Video on Demand

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Product Features
Features
Strengths
Scenarios
Solutions
Professional Edition
Introduction to Video On Demand Professional Edition
Quick Start
Console Guide
Development Guide
Purchase Guide
Billing Overview
Billing Modes
Purchase Guide
Viewing Bills
Renewal
Overdue Policy
Refund Policy
Getting Started
Console Guide
Console Overview
Service Overview
Application Management
Media Management
Package Management
License Management
Real-Time Log Analysis
Practical Tutorial
Media Upload
Smart Cold Storage of VOD Media Asset Files
Video Processing
Distribution and Playback
How to Receive Event Notification
How to Migrate Files from Origin Server to VOD
Live Recording
How to Pull from Custom Origin Servers
How to Use EdgeOne to Distribute Content in VOD
Development Guide
Media Upload
Media Processing
Video AI
Event Notification
Video Playback
Media Encryption and Copyright Protection
Broadcast Channel
CAM
Media File Download
Subapplication System
Error Codes
Player 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
Server APIs
History
Introduction
API Category
Other APIs
Media Processing APIs
Parameter Template APIs
Task Management APIs
Media Upload APIs
Media Management APIs
Event Notification Relevant API
Media Categorization APIs
Domain Name Management APIs
Distribution APIs
AI-based Sample Management APIs
Region Management APIs
Data Statistics APIs
Carousel-Related APIs
Just In Time Transcode APIs
No longer recommended APIs
Making API Requests
AI-based image processing APIs
Task Flow APIs
Data Types
Error Codes
Video on Demand API 2024-07-18
FAQs
Mobile Playback
Fees
Video Upload
Video Publishing
Video Playback
Web Playback
Full Screen Playback
Statistics
Access Management
Cold Storage
Agreements
Service Level Agreement
VOD Policy
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

TXPlayInfoParams

PDF
Focus Mode
Font Size
Last updated: 2025-05-30 15:08:59

TXPlayInfoParams API Introduction

VOD player plays media parameters, and you can configure Tencent Cloud fileId and url playback through TXPlayInfoParams.

API Overview

API
Description
Create a media instance that plays via Tencent Cloud VOD fileId.
Create a media instance that plays through URL.
Set the media asset type for player playback.
Set the Http header.
Set MP4 encrypted playback.
Set the preferred audio track for playback startup.

API Details

TXPlayInfoParams:fileId

Create a media instance that plays via Tencent Cloud VOD fileId.
public TXPlayInfoParams(int appId, String fileId, String pSign)
Parameter Description
Parameter Name
Type
Description
appId
int
Tencent Cloud Video on Demand (VOD) application appId.
fileId
String
Tencent Cloud Video on Demand (VOD) resource fileId.
pSign
String
Playback signature

TXPlayInfoParams:url

Create a media instance that plays through url.
public TXPlayInfoParams(String url)
Parameter Description
Parameter Name
Type
Description
url
String
Play the resource address.

setMediaType

Set the media type.
public void setMediaType(int mediaType)
Parameter Description
Parameter Name
Type
Description
mediaType
int
Set the media asset type. The default is AUTO type. Optional values:
TXVodConstants#MEDIA_TYPE_AUTO, AUTO type (default value, adaptive bit rate playback not supported).
TXVodConstants#MEDIA_TYPE_HLS_VOD, HLS VOD media.
TXVodConstants#MEDIA_TYPE_HLS_LIVE, HLS live media.
TXVodConstants#MEDIA_TYPE_FILE_VOD, common file VOD media such as MP4 (supported starting from version 11.2).
TXVodConstants#MEDIA_TYPE_DASH_VOD, DASH VOD media (supported starting from version 11.2).

setHeaders

Customize the player configuration to play the Http header carried during the online process.
public void setHeaders(Map<String, String> headers)
Parameter Description
Parameter Name
Type
Description
headers
Map<String, String>
Custom Http header content.

setEncryptedMp4Level

Set MP4 encrypted playback, not encrypted (default).
public void setEncryptedMp4Level(int level)
Parameter Description
Parameter Name
Type
Description
level
int
Set MP4 playback and storage encryption levels, supported starting from Player Premium 12.2, currently supports:
TXVodConstants#MP4_ENCRYPTION_LEVEL_NONE: No encryption playback, supported by default.
TXVodConstants#MP4_ENCRYPTION_LEVEL_L2: MP4 local encryption playback.

setPreferredAudioTrack

Set the preferred audio track for playback startup. Supported starting from Player Premium version 12.3.
In the pre-download scenario, configure to preferentially download the audio track.
public void setPreferredAudioTrack(String audioTrackName)
Parameter Description
Parameter Name
Type
Description
audioTrackName
String
audio track name.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback