2#include "plv-player-def.h"
PLAYERSDK_API PLVDownloadPtr PLAYERSDK_CALL PLVDownloadCreate()
创建下载对象并返回对象指针. 在使用下载接口对象前, 必须先调用此接口创建对象.
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadDelete(PLVDownloadPtr download)
删除视频文件. 如果视频正在下载中时, 会中断下载, 并删除所有临时文件, 并退出线程.
void * PLVDownloadPtr
下载对象, 每一个下载任务对应一个下载对象, 可以创建多个下载对象.
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadResetHandler(PLVDownloadPtr download)
重置所有回调通知, 会请空所有的回调函数地址.
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetInfo(PLVDownloadPtr download, const char *vid, const char *path, int rate)
设置视频信息. 在调用下载前, 必须先设置视频的相关信息, 否则会报错.
void(* OnDownloadErrorHandler)(const char *vid, int code, void *data)
过程中的错误信息回调通知.
PLAYERSDK_API bool PLAYERSDK_CALL PLVDownloadIsDownloading(PLVDownloadPtr download)
获取是否下载中状态.
void(* OnDownloadResultHandler)(const char *vid, int rate, int code, void *data)
下载结果的回调通知.
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetErrorHandler(PLVDownloadPtr download, OnDownloadErrorHandler handler, void *data)
设置下载错误的回调通知.
void(* OnDownloadProgressHandler)(const char *vid, long long receivedBytes, long long totalBytes, void *data)
下载进度的回调通知.
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadPause(PLVDownloadPtr download, bool pause)
暂停下载, 此时线程进入休眠, 不会退出, 区别于停止下载. 再开始下载时会更快些.
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetResultHandler(PLVDownloadPtr download, OnDownloadResultHandler handler, void *data)
设置下载结果的回调通知.
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadStop(PLVDownloadPtr download)
停止下载, 此时线程会回收退出, 区别于暂停下载. 再开始下载时会慢些.
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadStart(PLVDownloadPtr download, bool autoDownRate)
开始下载.
PLAYERSDK_API void PLAYERSDK_CALL PLVDownloadDestroy(PLVDownloadPtr download)
销毁下载对象. 不再使用创建的对象后, 必须调用此接口回收.
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetProgressHandler(PLVDownloadPtr download, OnDownloadProgressHandler handler, void *data)
设置下载进度的回调通知.