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. |
public void setConnectRetryCount(int count)
Parameter Name | Type | Description |
count | int | Reconnection attempts in playback exception scenarios. |
public void setTimeout(int timeout)
Parameter Name | Type | Description |
interval | int | Connection timeout, in seconds, default value is 10 seconds. |
TXPlayerGlobalSetting#setCacheFolderPath for global configuration.public void setCacheFolderPath(String folderPath)
Parameter Name | Type | Description |
folderPath | String | cache path. |
public void setMaxCacheItems(int maxCacheItems)
Parameter Name | Type | Description |
maxCacheItems | int | Maximum cache entries. |
public void setPlayerType(int playerType)
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. |
public void setHeaders(Map<String, String> headers)
Parameter Name | Type | Description |
headers | Map<String, String> | Custom Http header content. |
public void setEnableAccurateSeek(boolean accurateSeek)
Parameter Name | Type | Description |
accurateSeek | boolean | Set whether to seek accurately. |
public void setAutoRotate(boolean autoRotate)
Parameter Name | Type | Description |
autoRotate | boolean | Set whether to automatically rotate the angle during playback. |
public void setSmoothSwitchBitrate(boolean smoothSwitchBitrate)
Parameter Name | Type | Description |
smoothSwitchBitrate | boolean | Whether to smoothly switch between multiple bitrates for HLS. |
public void setCacheMp4ExtName(String cacheMp4ExtName)
Parameter Name | Type | Description |
cacheMp4ExtName | boolean | Filename extension. |
public void setProgressInterval(int intervalMs)
Parameter Name | Type | Description |
intervalMs | int | Interval time, in milliseconds. |
public void setMaxBufferSize(float maxBufferSize)
Parameter Name | Type | Description |
maxBufferSize | float | Playback buffer size |
public void setMaxPreloadSize(float maxPreloadSize)
Parameter Name | Type | Description |
maxPreloadSize | float | Preload size. |
public void setFirstStartPlayBufferTime(int milliseconds)
Parameter Name | Type | Description |
milliseconds | int | Duration size. |
public void setEnableRenderProcess(boolean enableRenderProcess)
Parameter Name | Type | Description |
enableRenderProcess | boolean | Set whether loading post-rendering post-processing services is allowed. |
public void setPreferredResolution(long preferredResolution)
Parameter Name | Type | Description |
preferredResolution | long | Product of video width and height (width * height). |
public void setEncryptedMp4Level(int level)
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. |
public void setMediaType(int mediaType)
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) |
public void setExtInfo(Map<String, Object> map)
Parameter Name | Type | Description |
map | Map | Expanded parameters |
public void setPreferredAudioTrack(String audioTrackName)
Parameter Name | Type | Description |
audioTrackName | String | audio track name. |
Feedback