plv player sdk doc
载入中...
搜索中...
未找到
plv-player-download-CN.h
浏览该文件的文档.
1#pragma once
2#include "plv-player-def.h"
4
7typedef void* PLVDownloadPtr;
14typedef void(*OnDownloadErrorHandler)(const char* vid, int code, void* data);
22typedef void(*OnDownloadProgressHandler)(const char* vid, long long receivedBytes, long long totalBytes, void* data);
30typedef void(*OnDownloadResultHandler)(const char* vid, int rate, int code, void* data);
37PLAYERSDK_API PLVDownloadPtr PLAYERSDK_CALL PLVDownloadCreate();
43PLAYERSDK_API void PLAYERSDK_CALL PLVDownloadDestroy(PLVDownloadPtr download);
53PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetErrorHandler(
54 PLVDownloadPtr download, OnDownloadErrorHandler handler, void* data);
64PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetProgressHandler(
65 PLVDownloadPtr download, OnDownloadProgressHandler handler, void* data);
75PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetResultHandler(
76 PLVDownloadPtr download, OnDownloadResultHandler handler, void* data);
84PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadResetHandler(PLVDownloadPtr download);
97PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetInfo(PLVDownloadPtr download, const char* vid, const char* path, int rate);
111PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadStart(PLVDownloadPtr download, const char* token, bool autoDownRate);
121PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadPause(PLVDownloadPtr download, bool pause);
130PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadStop(PLVDownloadPtr download);
139PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadDelete(PLVDownloadPtr download);
147PLAYERSDK_API bool PLAYERSDK_CALL PLVDownloadIsDownloading(PLVDownloadPtr download);
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 PLVDownloadStart(PLVDownloadPtr download, const char *token, bool autoDownRate)
开始下载.
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 void PLAYERSDK_CALL PLVDownloadDestroy(PLVDownloadPtr download)
销毁下载对象. 不再使用创建的对象后, 必须调用此接口回收.
PLAYERSDK_API int PLAYERSDK_CALL PLVDownloadSetProgressHandler(PLVDownloadPtr download, OnDownloadProgressHandler handler, void *data)
设置下载进度的回调通知.