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

protocol  <TXVodPreloadManagerDelegate>
 
class  TXVodPreloadManager
 

Detailed Description


Data Structure Documentation

◆ TXVodPreloadManagerDelegate-p

protocol TXVodPreloadManagerDelegate-p

The callback for video predownloading.

+ Inheritance diagram for <TXVodPreloadManagerDelegate>:

Instance Methods

(void) - onComplete:url:
 
(void) - onError:url:error:
 

Method Documentation

◆ onComplete:url:()

- (void) onComplete: (int)  taskID
url: (NSString *)  url 
optional

The callback for download completion.

Parameters
taskIDThe download task ID
urlThe download task URL

◆ onError:url:error:()

- (void) onError: (int)  taskID
url: (NSString *)  url
error: (NSError *)  error 
optional

The callback for download error.

Parameters
taskIDThe download task ID
urlThe download task URL
errorThe error message of the download failure

◆ TXVodPreloadManager

class TXVodPreloadManager

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.

+ Inheritance diagram for TXVodPreloadManager:

Instance Methods

(int) - startPreload:preloadSize:preferredResolution:delegate:
 
(void) - stopPreload:
 

Class Methods

(instancetype) + sharedManager
 

Method Documentation

◆ sharedManager()

+ (instancetype) sharedManager

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

◆ startPreload:preloadSize:preferredResolution:delegate:()

- (int) startPreload: (NSString *)  requestURL
preloadSize: (int)  preloadSizeMB
preferredResolution: (long)  preferredResolution
delegate: (id< TXVodPreloadManagerDelegate >)  delegate 

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
requestURLThe 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.
delegate/listenerThe callback
Returns
The task ID, which can be used to stop predownloading by calling [ TXVodPreloadManager stopPreload ].

◆ stopPreload:()

- (void) stopPreload: (int)  taskID

This API is used to stop predownloading.

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