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 정책
개인 정보 보호 정책
데이터 처리 및 보안 계약
문의하기
용어집

TXVodPlayConfig

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-05-30 15:02:13

TXVodPlayConfig API Introduction

on-demand player playback configuration, need to be set before playback.

API Overview

API
Description
Set the player's reconnection attempts in abnormal scenarios.
Set the player connection timeout period.
Set the player type.
Set the Http header.
Set whether to seek accurately.
Set whether to automatically rotate the angle when playing MP4.
Set whether to smoothly switch between multiple bitrates for HLS.
Set the cache for MP4 filename extension.
Set interval for progress callbacks.
Set the maximum playback buffer size for the player.
Set the maximum preload buffer size.
Set whether the player is allowed to load post-processing services.
Set the optimal HLS stream for startup playback.
Set MP4 encrypted playback.
Set the media asset type for player playback.
Set the player's expanded parameters.
Set the preferred audio track for startup playback.

API Detail

setConnectRetryCount

Set the player's reconnection attempts in abnormal scenarios.
When the SDK is disconnected due to an exception from the server, it will attempt to reconnect to the server. Use this function to set the reconnection attempts of the SDK, with a default value of 3.
public void setConnectRetryCount(int count)
Parameter Description
Parameter Name
Type
Description
count
int
Reconnection attempts in playback exception scenarios.

setTimeout

Set the player connection timeout period, with a default value of 10 seconds.
public void setTimeout(int timeout)
Parameter Description
Parameter Name
Type
Description
interval
int
Connection timeout, in seconds, default value is 10 seconds.

setCacheFolderPath

Set the video-on-demand cache directory.
Note: This API is deprecated. Please use TXPlayerGlobalSetting#setCacheFolderPath for global configuration.
public void setCacheFolderPath(String folderPath)
Parameter Description
Parameter Name
Type
Description
folderPath
String
cache path.

setMaxCacheItems

Set the number of cached files.
Note: This API is deprecated. Please use TXPlayerGlobalSetting#setMaxCacheSize for global configuration.
public void setMaxCacheItems(int maxCacheItems)
Parameter Description
Parameter Name
Type
Description
maxCacheItems
int
Maximum cache entries.

setPlayerType

Set player type, default is Tencent Cloud proprietary player.
public void setPlayerType(int playerType)
Parameter Description
Parameter Name
Type
Description
playerType
int
Player type, valid values:
TXVodConstants#PLAYER_SYSTEM_MEDIA_PLAYER: Android system player.
TXVodConstants#PLAYER_THUMB_PLAYER: Tencent Cloud proprietary player, default value.

setHeaders

Customize configuration for the player to play with Http headers 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.

setEnableAccurateSeek

Set whether to seek accurately. Default true.
public void setEnableAccurateSeek(boolean accurateSeek)
Parameter Description
Parameter Name
Type
Description
accurateSeek
boolean
Set whether to seek accurately.

setAutoRotate

When playing an MP4 file, if set to YES, it will automatically rotate according to the rotation angle in the file. The rotation angle can be obtained in the PLAY_EVT_CHANGE_ROTATION event, with a default value of YES.
public void setAutoRotate(boolean autoRotate)
Parameter Description
Parameter Name
Type
Description
autoRotate
boolean
Set whether to automatically rotate the angle during playback.

setSmoothSwitchBitrate

Set whether to smoothly switch between multiple bitrates for HLS, default false.
public void setSmoothSwitchBitrate(boolean smoothSwitchBitrate)
Parameter Description
Parameter Name
Type
Description
smoothSwitchBitrate
boolean
Whether to smoothly switch between multiple bitrates for HLS.

setCacheMp4ExtName

Set the cache for mp4 filename extension. The default is mp4.
public void setCacheMp4ExtName(String cacheMp4ExtName)
Parameter Description
Parameter Name
Type
Description
cacheMp4ExtName
boolean
Filename extension.

setProgressInterval

Set the interval for progress callbacks, with a default value of 0.5 seconds per callback.
public void setProgressInterval(int intervalMs)
Parameter Description
Parameter Name
Type
Description
intervalMs
int
Interval time, in milliseconds.

setMaxBufferSize

Set the maximum playback buffer size, in MB.
public void setMaxBufferSize(float maxBufferSize)
Parameter Description
Parameter Name
Type
Description
maxBufferSize
float
Playback buffer size

setMaxPreloadSize

Set the maximum preload buffer size, in MB.
public void setMaxPreloadSize(float maxPreloadSize)
Parameter Description
Parameter Name
Type
Description
maxPreloadSize
float
Preload size.

setFirstStartPlayBufferTime

Set the data duration for the player's initial preload, in ms, with a default value of 100ms.
Note: This API is deprecated. Please use #setMaxBufferSize or #setMaxPreloadSize to set the buffer size.
public void setFirstStartPlayBufferTime(int milliseconds)
Parameter Description
Parameter Name
Type
Description
milliseconds
int
Duration size.

setEnableRenderProcess

Set whether the player is allowed to load post-processing services, off by default.
public void setEnableRenderProcess(boolean enableRenderProcess)
Parameter Description
Parameter Name
Type
Description
enableRenderProcess
boolean
Set whether loading post-rendering post-processing services is allowed.

setPreferredResolution

When playing HLS with multiple streams, the player selects the optimal stream for startup playback based on the set preferredResolution, which is the product of width and height (width * height).
Settings are only valid before playback starts.
public void setPreferredResolution(long preferredResolution)
Parameter Description
Parameter Name
Type
Description
preferredResolution
long
Product of video width and height (width * height).

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: Unencrypted playback, supported by default.
TXVodConstants#MP4_ENCRYPTION_LEVEL_L2: MP4 local encrypted playback.

setMediaType

Set the media asset type for player playback, default is AUTO type.
public void setMediaType(int mediaType)
Parameter Description
Parameter Name
Type
Description
mediaType
int
Set the media asset type, 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)

setExtInfo

Set the player's expanded parameters.
public void setExtInfo(Map<String, Object> map)
Parameter Description
Parameter Name
Type
Description
map
Map
Expanded parameters

setPreferredAudioTrack

Set the preferred audio track for startup playback, supported starting from Player Premium version 12.3.
public void setPreferredAudioTrack(String audioTrackName)
Parameter Description
Parameter Name
Type
Description
audioTrackName
String
audio track name.

도움말 및 지원

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

피드백