LiteAVSDK
Tencent Cloud TRTC SDK, is a high availability components serving tens of thousands of enterprise customers, which is committed to helping you to minimize your research and development costs.
TXVodPreloadManager

Data Structures

class  TXVodPreloadManager
 

Detailed Description

Video predownloading. You can download part of the video content in advance without creating a player instance, so as to start playing back the video faster when using the player. This helps deliver a better playback experience.


Data Structure Documentation

◆ com::tencent::rtmp::downloader::TXVodPreloadManager

class com::tencent::rtmp::downloader::TXVodPreloadManager

Public Member Functions

int startPreload (final String url, final int preloadSizeMB, final long preferredResolution, final ITXVodPreloadListener listener)
 
void stopPreload (int taskID)
 

Static Public Member Functions

static TXVodPreloadManager getInstance (Context context)
 

Member Function Documentation

◆ getInstance()

static TXVodPreloadManager getInstance ( Context  context)
inlinestatic

This API is used to get the video predownloading singleton object.

Parameters
context
Returns

◆ startPreload()

int startPreload ( final String  url,
final int  preloadSizeMB,
final long  preferredResolution,
final ITXVodPreloadListener  listener 
)
inline

This API is used to start predownloading.

Attention
Set the player engine cache directory [TXPlayerGlobalSetting setCacheFolderPath: ] and cache size [ TXPlayerGlobalSetting setMaxCacheSizeMB:] before starting predownloading. Such settings are global and must be consistent with those of the player; otherwise, the player cache will become invalid.
Parameters
urlThe predownload URL
preloadSizeMBThe size of the data to be predownloaded in MB
preferredResolutionThe preferred resolution of long type. Sample value: TXVodPlayConfig.VIDEO_RESOLUTION_720X1280. If multi-resolution is not supported or not needed, pass in -1.
listenerThe callback
Returns
The task ID, which can be used to stop predownloading by calling [ TXVodPreloadManager stopPreload ].

◆ stopPreload()

void stopPreload ( int  taskID)
inline

This API is used to stop predownloading.

Parameters
taskIDThe task ID, which is obtained from the returned value of TXVodPreloadManager#startPreload.