plv player sdk doc
Loading...
Searching...
No Matches
Typedefs | Functions
Downloader Api

Typedefs

typedef void * PLVDownloadPtr
 download object type.
 
typedef void(* OnDownloadErrorHandler) (const char *vid, int code, void *data)
 for Callback notification of error messages during the process.
 
typedef void(* OnDownloadProgressHandler) (const char *vid, long long receivedBytes, long long totalBytes, void *data)
 for download progress callback.
 
typedef void(* OnDownloadResultHandler) (const char *vid, int rate, int code, void *data)
 for download result callback.
 

Functions

PLAYERSDK_API PLVDownloadPtr PLAYERSDK_CALL PLVDownloadCreate ()
 Creates the PLVDownloader object and returns the pointer.
 
PLAYERSDK_API void PLAYERSDK_CALL PLVDownloadDestroy (PLVDownloadPtr download)
 Destory the PLVDownloader object.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetErrorHandler (PLVDownloadPtr download, OnDownloadErrorHandler handler, void *data)
 for in the download process error callback.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetProgressHandler (PLVDownloadPtr download, OnDownloadProgressHandler handler, void *data)
 for download progress callback.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetResultHandler (PLVDownloadPtr download, OnDownloadResultHandler handler, void *data)
 for download result callback.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadResetHandler (PLVDownloadPtr download)
 for reset all handler, will clear all callback function.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetInfo (PLVDownloadPtr download, const char *vid, const char *path, int rate)
 set the video info before download.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadStart (PLVDownloadPtr download, const char *token, bool autoDownRate)
 start download the video.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadPause (PLVDownloadPtr download, bool pause)
 pause download the video, the thread not exit.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadStop (PLVDownloadPtr download)
 stop download the video, the thread will exit.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadDelete (PLVDownloadPtr download)
 delete the video file, will abort the download and exit thread.
 
PLAYERSDK_API bool PLAYERSDK_CALL PLVDownloadIsDownloading (PLVDownloadPtr download)
 check download status.
 

Detailed Description

Typedef Documentation

◆ OnDownloadErrorHandler

typedef void(* OnDownloadErrorHandler) (const char *vid, int code, void *data)

for Callback notification of error messages during the process.

Parameters
[out]vidvideo id.
[out]codeerror code.
[out]datauser context data.

Definition at line 15 of file plv-player-download.h.

◆ OnDownloadProgressHandler

typedef void(* OnDownloadProgressHandler) (const char *vid, long long receivedBytes, long long totalBytes, void *data)

for download progress callback.

Parameters
[out]vidvideo id.
[out]receivedBytesdownload pos.
[out]totalBytesfile all size.
[out]datauser context data.

Definition at line 23 of file plv-player-download.h.

◆ OnDownloadResultHandler

typedef void(* OnDownloadResultHandler) (const char *vid, int rate, int code, void *data)

for download result callback.

Parameters
[out]vidvideo id.
[out]ratethe video rate.
[out]codeerror code.
[out]datauser context data.

Definition at line 31 of file plv-player-download.h.

◆ PLVDownloadPtr

typedef void* PLVDownloadPtr

download object type.

Definition at line 8 of file plv-player-download.h.

Function Documentation

◆ PLVDownloadCreate()

PLAYERSDK_API PLVDownloadPtr PLAYERSDK_CALL PLVDownloadCreate ( )

Creates the PLVDownloader object and returns the pointer.

Returns
  • Pointer: to the PLVDownloader object.

◆ PLVDownloadDelete()

PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadDelete ( PLVDownloadPtr download)

delete the video file, will abort the download and exit thread.

Parameters
downloadthe download object, for PLVDownloadCreate return.
See also
PLVDownloadCreate.
Returns
  • 0: Success.
  • > 0: Failure.

◆ PLVDownloadDestroy()

PLAYERSDK_API void PLAYERSDK_CALL PLVDownloadDestroy ( PLVDownloadPtr download)

Destory the PLVDownloader object.

Parameters
downloadthe download object, for PLVDownloadCreate return.
See also
PLVDownloadCreate.

◆ PLVDownloadIsDownloading()

PLAYERSDK_API bool PLAYERSDK_CALL PLVDownloadIsDownloading ( PLVDownloadPtr download)

check download status.

Parameters
downloadthe download object, for PLVDownloadCreate return.
See also
PLVDownloadCreate.
Returns
  • true: Downloading.
  • false: Idle.

◆ PLVDownloadPause()

PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadPause ( PLVDownloadPtr download,
bool pause )

pause download the video, the thread not exit.

Parameters
downloadthe download object, for PLVDownloadCreate return.
See also
PLVDownloadCreate.
Parameters
pausedownload state.
Returns
  • 0: Success.
  • > 0: Failure.

◆ PLVDownloadResetHandler()

PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadResetHandler ( PLVDownloadPtr download)

for reset all handler, will clear all callback function.

Parameters
downloadthe download object, for PLVDownloadCreate return.
See also
PLVDownloadCreate.
Returns
  • 0: Success.
  • > 0: Failure.

◆ PLVDownloadSetErrorHandler()

PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetErrorHandler ( PLVDownloadPtr download,
OnDownloadErrorHandler handler,
void * data )

for in the download process error callback.

Parameters
downloadthe download object, for PLVDownloadCreate return.
See also
PLVDownloadCreate.
Parameters
handlercallback function.
datauser context data.
Returns
  • 0: Success.
  • > 0: Failure.

◆ PLVDownloadSetInfo()

PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetInfo ( PLVDownloadPtr download,
const char * vid,
const char * path,
int rate )

set the video info before download.

Parameters
downloadthe download object, for PLVDownloadCreate return.
See also
PLVDownloadCreate.
Parameters
vidthe video id.
paththe video file path, use UTF8.
ratethe video rate.
See also
VIDEO_RATE_TYPE.
Returns
  • 0: Success.
  • > 0: Failure.
Attention
path must use UTF8

◆ PLVDownloadSetProgressHandler()

PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetProgressHandler ( PLVDownloadPtr download,
OnDownloadProgressHandler handler,
void * data )

for download progress callback.

Parameters
downloadthe download object, for PLVDownloadCreate return.
See also
PLVDownloadCreate.
Parameters
handlercallback function.
datauser context data.
Returns
  • 0: Success.
  • > 0: Failure.

◆ PLVDownloadSetResultHandler()

PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetResultHandler ( PLVDownloadPtr download,
OnDownloadResultHandler handler,
void * data )

for download result callback.

Parameters
downloadthe download object, for PLVDownloadCreate return.
See also
PLVDownloadCreate.
Parameters
handlercallback function.
datauser context data.
Returns
  • 0: Success.
  • > 0: Failure.

◆ PLVDownloadStart()

PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadStart ( PLVDownloadPtr download,
const char * token,
bool autoDownRate )

start download the video.

Parameters
downloadthe download object, for PLVDownloadCreate return.
See also
PLVDownloadCreate.
Parameters
tokenencryption video mute use it.
autoDownRateif false will no exist the rate return error.
Returns
  • 0: Success.
  • > 0: Failure.
Note
If the disk space is less than 100M, an error will be reported.

◆ PLVDownloadStop()

PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadStop ( PLVDownloadPtr download)

stop download the video, the thread will exit.

Parameters
downloadthe download object, for PLVDownloadCreate return.
See also
PLVDownloadCreate.
Returns
  • 0: Success.
  • > 0: Failure.