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.
◆ com::tencent::rtmp::downloader::TXVodPreloadManager
class com::tencent::rtmp::downloader::TXVodPreloadManager |
◆ getInstance()
This API is used to get the video predownloading singleton object.
- Parameters
-
- 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
-
url | The predownload URL |
preloadSizeMB | The size of the data to be predownloaded in MB |
preferredResolution | The preferred resolution of long type. Sample value: TXVodPlayConfig.VIDEO_RESOLUTION_720X1280. If multi-resolution is not supported or not needed, pass in -1 . |
listener | The 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
-