API | Description |
Sets the player configuration information. For more information on the configuration, see TXVodPlayConfig. | |
Sets the player’s rendering view TXCloudVideoView . | |
Sets the player’s rendering view TextureView . | |
Sets the player’s rendering view SurfaceView . | |
Sets the player business parameters in the format of <String,Object> . | |
Sets the subtitle style information and can update the subtitle style after playback (only supported in the advanced version of the player). | |
Sets the subtitle software decoding target object (only supported in the advanced version of the player). | |
setAudioNormalization | Setting volume normalization, loudness range: -70 to 0 (LUFS). Supported from player version 11.7 of the premium version.
You can set the volume normalization to preset values or custom values. The preset values are defined in the related classes or files, such asTXVodConstants for Android and TXVodPlayConfig.hfor iOS:
Off: AUDIO_NORMALIZATION_OFF On: AUDIO_NORMALIZATION_STANDARD (standard)
AUDIO_NORMALIZATION_LOW (low)
AUDIO_NORMALIZATION_HIGH (high)
Custom values can be set in the range of -70 to 0 LUFS, from low to high. |
API | Description |
Plays a video from an HTTP URL. Since v10.7, startPlay has been replaced by startVodPlay , and you need to call V2TXLivePremier#setLicence or TXLiveBase#setLicence to set the license in order to use the playback feature (you only need to set the license once). Otherwise, playback will fail (black screen). You can use a live stream publishing license, UGSV license, or video playback license to activate the playback feature. | |
Plays a video by VOD file ID. Since v10.7, startPlay has been replaced by startVodPlay , and you need to call V2TXLivePremier#setLicence or TXLiveBase#setLicence to set the license in order to use the playback feature (you only need to set the license once). Otherwise, playback will fail (black screen). You can use a live stream publishing license, UGSV license, or video playback license to activate the playback feature. | |
Stops playback. | |
Gets whether playback is ongoing. | |
Pauses playback. The player will stop pulling data and freeze on the last frame. | |
Resumes playback. The player will resume pulling data. | |
Seeks to a specified time point of the video stream (in seconds). | |
Seeks to a specified time point of the video stream (in ms). | |
Gets the current playback time point in seconds. | |
Gets the total buffer duration in seconds. | |
Gets the total video duration in seconds. | |
Gets the playable video duration in seconds. | |
Gets the video width. | |
Gets the video height. | |
Sets whether to start playback automatically after startVodPlay is called. Auto-play is on by default. | |
Sets the playback start time. | |
Sets the token for HLS encryption. | |
Sets whether to loop the video. | |
Gets whether playback is looped. | |
Adds external subtitles (only supported in the advanced version of the player). | |
Returns a list of subtitle track information (only supported in the advanced version of the player). | |
Returns a list of audio track information (only supported in the advanced version of the player). | |
Selects a track (only supported in the advanced version of the player). | |
Deselects a track (only supported in the advanced version of the player). | |
seekToPdtTime | Seek to the specified Program Date Time (PDT) point in the video stream, which enables functions such as fast-forward, rewind, and progress bar jumping. Currently, only HLS video format is supported. This function is supported starting from version 11.6 of the player's advanced edition. The parameter unit is milliseconds (ms). |
API | Description |
Enables/Disables video hardware decoding. | |
Gets the current video frame image. Note: Because this operation is time-consuming, the screenshot will be called back asynchronously. | |
Sets whether to flip the video image horizontally. | |
Sets the VOD playback speed. Default value: 1.0. | |
Returns the current playback bitrate index. | |
Sets the current playback bitrate index for seamless definition switch. You may need to wait momentarily to switch the definition. | |
Sets the image fill mode. | |
Sets the rotation. |
API | Description |
Sets whether to mute the player. | |
Sets the volume level. Value range: 0–100. | |
Sets whether to get the audio focus automatically. The audio focus is gotten automatically by default. |
API | Description |
Sets player callbacks. |
API | Description |
Starts pushing the video stream. | |
Cancels pushing the video stream. | |
Starts pushing the audio stream. | |
Cancels pushing the audio stream. |
API | Description |
VOD playback event notification. For more information, see the playback event list and event parameters. | |
API | Description |
Sets the maximum number of player reconnection attempts. | |
Sets the player reconnection interval in seconds. | |
Sets the player connection timeout period in seconds. | |
Sets the VOD cache directory, which takes effect for MP4 and HLS files. | |
Sets the maximum number of cached files. This API has been deprecated. Use TXPlayerGlobalSetting#setMaxCacheSize for global configuration. | |
Sets the player type. TXVodConstants#PLAYER_SYSTEM_MEDIA_PLAYER: Use the system's built-in player. TXVodConstants#PLAYER_THUMB_PLAYER: Use Tencent Cloud's self-developed player. | |
Sets custom HTTP headers. | |
Sets whether to enable accurate seek. Default value: true. | |
Sets whether to enable auto rotation. If the parameter is set to YES (default), MP4 files will be automatically rotated. You can get the rotation angle from the PLAY_EVT_CHANGE_ROTATION callback. | |
Sets whether to enable smooth switching for multi-bitrate HLS streams. Default value: false. | |
Sets the extension for cached MP4 files. | |
Sets the progress callback interval in ms. | |
Sets the maximum buffer size in MB. | |
Set the maximum buffer size for preloading, in MB. | |
Set extended information. | |
When playing HLS with multiple streams, select the optimal stream for playback based on the set preferredResolution, which is the product of the width and height (width * height). This setting takes effect before playback. | |
Set the encryption and decryption key for HLS security reinforcement. | |
Set the encryption and decryption IV for HLS security reinforcement. | |
Enable or disable loading and rendering post-processing services. | |
Set the media type, with AUTO as the default value. Optional values are: TXVodConstants#MEDIA_TYPE_AUTO, AUTO type (default value, adaptive bit rate playback is not supported for now); TXVodConstants#MEDIA_TYPE_HLS_VOD, HLS VOD media; TXVodConstants#MEDIA_TYPE_HLS_LIVE, HLS live media; TXVodConstants#MEDIA_TYPE_HLS_VOD, MP4 and other common file VOD media (supported starting from version 11.2); TXVodConstants#MEDIA_TYPE_DASH_VOD, DASH VOD media (supported starting from version 11.2); |
API | Description |
Sets the cache directory of the playback engine. After setting, this directory will be first read and written during downloading, predownloading, and player use. | |
Sets the playback engine’s maximum cache size in MB. The cache directory will be cleared automatically if its size exceeds the specified value. | |
setDrmProvisionEnv | Set the Drm certificate provider environment (supported starting from version 11.2). Optional values are: TXPlayerGlobalSetting.DrmProvisionEnv#DRM_PROVISION_ENV_COM, which represents the use of the Google COM domain name certificate provider; TXPlayerGlobalSetting.DrmProvisionEnv#DRM_PROVISION_ENV_CN, which represents the use of the Google CN domain name certificate provider; |
API | Description |
Gets a singleton object of TXVodPreloadManager . | |
Starts predownloading. Before you call this API, make sure you have called TXPlayerGlobalSetting#setCacheFolderPath and TXPlayerGlobalSetting#setMaxCacheSize to set the cache directory and maximum cache size. | |
Stops predownloading. |
API | Description |
Video pre-download is complete. | |
Video pre-download encountered an error. |
API | Description |
Gets a singleton object of TXVodDownloadManager . | |
Sets download HTTP headers. | |
Sets the download callback. This API must be called before the download. | |
Starts downloading the video at the specified URL. | |
Starts downloading the video of the specified fileid . | |
Stops the download. If ITXVodDownloadListener.onDownloadStop is called back, the download stops successfully. | |
Deletes the download information. | |
Gets the download lists of all users. | |
Gets the download information. |
API | Description |
Download started. | |
The download progress was updated. | |
Download stopped. | |
Download ended. | |
An error occurred during download. | |
When downloading HLS, if an encrypted file is encountered, the decryption key is passed to the external party for verification. |
fileid
) APIs. You need to pass in the source information when starting download.API | Description |
Builds a function to pass in parameters such as appid , fileid , quality , psign , and username . | |
Gets the appid that is passed in. | |
Gets the fileid that is passed in. | |
Gets the psign that is passed in. | |
Gets the quality that is passed in. | |
Gets the userName that is passed in, which is default by default. |
code | Constant Definition | Description |
0 | Original quality | |
1 | Smooth quality | |
2 | Standard definition | |
3 | High definition | |
4 | Full high definition | |
5 | 2K | |
6 | 4K | |
1000 | Undefined quality | |
240 | TXVodQuality240P | Smooth 240P |
360 | TXVodQuality360P | Smooth 360P |
480 | TXVodQuality480P | Standard definition 480P |
540 | TXVodQuality540P | Standard definition 540P |
720 | TXVodQuality720P | High definition 720P |
1080 | TXVodQuality1080p | Full high definition 1080P |
API | Description |
Gets the source specified by the fileid passed in for download. | |
Gets the total duration of the video. | |
Gets the downloaded (playable) duration of the video. | |
Gets the total size of the file being downloaded. This API takes effect only for download by fileid . | |
Gets the size of the data already downloaded. This API takes effect only for download by fileid . | |
Gets the current download progress. | |
Gets the current playback path, which can be passed in to TXVodPlayer for playback. | |
Gets the download status. | |
Gets whether the download is completed. | |
Get download speed, in KBytes/second. (Supported starting from version 10.9) | |
isResourceBroken | Determine whether the downloaded video resource is damaged. If the downloaded file is deleted, etc., true will be returned. (Supported starting from version 11.0) |
Code | Property Definition | Description |
0 | STATE_INIT | Initial state of download |
1 | STATE_START | Download started |
2 | STATE_STOP | Download stopped |
3 | STATE_ERROR | Download error |
4 | STATE_FINISH | Download completed |
API | Description |
Constructor. | |
Set the sprite image address. | |
Get the thumbnail. | |
Call this method when finished to avoid memory leaks. |
API | Description |
Construct the DRM playback information object. | |
Set the certificate provider URL. | |
Set the decryption key URL. | |
Set the URL for playing media. |
API | Description |
Constructor. | |
Get the application ID. | |
Get the file ID. | |
Get the Tencent Cloud video encryption signature. |
Code | Event Definition | Description |
2004 | PLAY_EVT_PLAY_BEGIN | Video playback started, and the loading icon animation (if any) ended. |
2005 | PLAY_EVT_PLAY_PROGRESS | The video playback progress (including the current playback progress, the loaded duration, and the total video duration). |
2007 | PLAY_EVT_PLAY_LOADING | The video is being loaded. The LOADING_END event will be reported if video playback resumes. |
2014 | PLAY_EVT_VOD_LOADING_END | Video loading ended, and video playback resumed. |
2006 | PLAY_EVT_PLAY_END | Video playback ended. |
2013 | PLAY_EVT_VOD_PLAY_PREPARED | The player is ready. |
2003 | PLAY_EVT_RCV_FIRST_I_FRAME | The first renderable video data packet (IDR) was received. |
2009 | PLAY_EVT_CHANGE_RESOLUTION | The video resolution changed. |
2011 | PLAY_EVT_CHANGE_ROTATION | The MP4 video was rotated. |
Code | Event Definition | Description |
-2301 | PLAY_ERR_NET_DISCONNECT | The network was disconnected and could not be reconnected after multiple retries. You can restart the player to perform more connection retries. |
-2305 | PLAY_ERR_HLS_KEY | Failed to get the HLS decryption key. |
2101 | PLAY_WARNING_VIDEO_DECODE_FAIL | Failed to decode the current video frame. |
2102 | PLAY_WARNING_AUDIO_DECODE_FAIL | Failed to decode the current audio frame. |
2103 | PLAY_WARNING_RECONNECT | The player was disconnected and is trying to reconnect. The PLAY_ERR_NET_DISCONNECT event will be thrown after three failed attempts. |
2106 | PLAY_WARNING_HW_ACCELERATION_FAIL | Failed to start the hardware decoder, and the software decoder was used instead. |
-2304 | PLAY_ERR_HEVC_DECODE_FAIL | H.265 decoding failed. |
-2303 | PLAY_ERR_FILE_NOT_FOUND | The file to be played back does not exist. |
code | Event definitions | Description |
0 | Full screen display of video. | |
1 | Adaptive display of video on screen. |
code | Event Definition | Description |
0 | Normal portrait. | |
270 | Rotated 90 degrees to the right. |
code | Event Definition | Description |
2003 | The network has received the first video data packet (IDR). | |
2004 | Video playback has started. | |
2005 | Video playback progress. | |
2006 | Video playback has ended. | |
2007 | Video playback is loading. | |
2008 | The decoder has started. | |
2009 | Video resolution has changed. | |
2010 | Successfully obtained information about the VOD file. | |
2011 | Video rotation information. | |
2013 | Video has finished loading. | |
2014 | Loading has ended. | |
2026 | The first audio frame has been played. | |
2103 | Network disconnected, automatic reconnection has been started. | |
-2301 | Network disconnected, and multiple reconnection attempts have failed. | |
-2303 | File not found. | |
-2304 | H.265 decoding failed. | |
-2305 | Failed to obtain the HLS decryption key. | |
-2306 | Failed to obtain information about the VOD file. | |
2106 | Hardware acceleration failed and software decoding is being used. | |
-5 | Invalid license, playback failed. Note: Before calling startVodPlay, you need to set the license using TXLiveBase#setLicence to play successfully. Otherwise, playback will fail (black screen). Set the license only once globally. Live streaming licenses, short video licenses, and video playback licenses can be used. If you have not obtained the above licenses, you can apply for a free trial license to play normally. The official license needs to be purchased. |
Event Definition | Description |
UTC time. | |
Time when the event occurred. | |
Event description. | |
Event parameter 1. | |
Event parameter 2. | |
Video cover URL. | |
Video URL. | |
Video name. | |
Video description. | |
Playback progress (in milliseconds). | |
Total playback time (in milliseconds). | |
Playback progress. | |
Total playback time. | |
Playable duration of VOD (in milliseconds). | |
Playback rate. | |
Playable duration of VOD. | |
URL for downloading the webVTT description file of the sprite image. | |
URL list for downloading the sprite image. | |
Encryption type. | |
Video encoding type. | |
Video keyframe description information. | |
Keyframe time. |
Event Definition | Description |
CPU usage. | |
Video width. | |
Video height. | |
Current video frame rate. | |
Current video GOP. | |
Video bitrate. | |
Audio bitrate. | |
Network speed. | |
Number of audio frames. | |
Number of video frames. | |
Audio information of the current stream. | |
Network jitter. | |
Server IP address connected to. | |
Current decoder output frame rate. | |
Network quality level. |
Code | Event Definition | Description |
0 | Auto type. | |
1 | Adaptive bitrate playback of HLS VOD media. | |
2 | Adaptive bitrate playback of HLS live media. |
Code | Event Definition | Description |
-1 | Adaptive bitrate index identifier. |
Was this page helpful?