tencent cloud

Video on Demand

Agreements
Service Level Agreement
Kebijakan VOD
Kebijakan Privasi
Perjanjian Pemrosesan dan Keamanan Data
DocumentationVideo on Demand

TXPlayInfoParams

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