plv player sdk doc
载入中...
搜索中...
未找到
plv-player-vod-CN.h
浏览该文件的文档.
1#pragma once
2#include "plv-player-def-CN.h"
3
5
8typedef void *PLVPlayerPtr;
15typedef bool (*OnPlayerVideoFrameHandler)(const char *vid, PLVVideoFrame *frame, void *data);
22typedef void (*OnPlayerStateHandler)(const char *vid, int state, void *data);
31typedef void (*OnPlayerPropertyHandler)(const char *vid, int property, int format, const char *value, void *data);
41typedef void (*OnPlayerRateChangeHandler)(const char *vid, int inputRate, int realRate, void *data);
49typedef void (*OnPlayerProgressHandler)(const char *vid, int millisecond, void *data);
50
56typedef void (*OnPlayerAudioPlayErrorHandler)(const char *vid, void *data);
57
66PLAYERSDK_API PLVPlayerPtr PLAYERSDK_CALL PLVPlayerCreate(void *window);
67
73PLAYERSDK_API void PLAYERSDK_CALL PLVPlayerDestroy(PLVPlayerPtr player);
84PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVideoFrameHandler(PLVPlayerPtr player,
85 OnPlayerVideoFrameHandler lockHandler,
86 OnPlayerVideoFrameHandler unlockHandler, void *data);
96PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetStateHandler(PLVPlayerPtr player, OnPlayerStateHandler handler,
97 void *data);
107PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetPropertyHandler(PLVPlayerPtr player, OnPlayerPropertyHandler handler,
108 void *data);
119PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetRateChangeHandler(PLVPlayerPtr player, OnPlayerRateChangeHandler handler,
120 void *data);
130PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetProgressHandler(PLVPlayerPtr player, OnPlayerProgressHandler handler,
131 void *data);
132
142PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetAudioPlayErrorHandler(PLVPlayerPtr player,
143 OnPlayerAudioPlayErrorHandler handler, void *data);
144
152PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerResetHandler(PLVPlayerPtr player);
162PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetOSDConfig(PLVPlayerPtr player, bool enable,
163 const PLVOsdConfigInfo *config);
172PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetOSDConfig(PLVPlayerPtr player, PLVOsdConfigInfo &config);
182PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetLogoText(PLVPlayerPtr player, bool enable, const PLVLogoTextInfo *config);
191PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetLogoText(PLVPlayerPtr player, PLVLogoTextInfo &config);
204PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetCacheConfig(PLVPlayerPtr player, bool enable, int maxCacheBytes,
205 int maxCacheSeconds);
215PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCacheConfig(PLVPlayerPtr player, int *maxCacheBytes, int *maxCacheSeconds);
225PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSeekCacheEnable(PLVPlayerPtr player, bool enable);
238PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetInfo(PLVPlayerPtr player, const char *vid, const char *path, int rate);
254PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPlay(PLVPlayerPtr player, const char *token, int seekMillisecond,
255 bool autoDownRate);
270PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPlayLocal(PLVPlayerPtr player, int seekMillisecond, bool autoDownRate);
285PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerLoadLocal(PLVPlayerPtr player, int seekMillisecond, bool autoDownRate);
294PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPause(PLVPlayerPtr player, bool pause);
302PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerStop(PLVPlayerPtr player);
311PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetMute(PLVPlayerPtr player, bool mute);
320PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSeek(PLVPlayerPtr player, int millisecond);
328PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSeekToEnd(PLVPlayerPtr player);
337PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVolume(PLVPlayerPtr player, int volume);
346PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVolumeMax(PLVPlayerPtr player, int volume);
356PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerScreenshot(PLVPlayerPtr player, const char *filename);
365PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSpeed(PLVPlayerPtr player, double speed);
373PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsMute(PLVPlayerPtr player);
381PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsValid(PLVPlayerPtr player);
389PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsPause(PLVPlayerPtr player);
397PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsPlaying(PLVPlayerPtr player);
405PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsLoaded(PLVPlayerPtr player);
413PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsLoading(PLVPlayerPtr player);
421PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentRateCount(PLVPlayerPtr player);
429PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentRate(PLVPlayerPtr player);
437PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetVolume(PLVPlayerPtr player);
445PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetDuration(PLVPlayerPtr player);
452PLAYERSDK_API double PLAYERSDK_CALL PLVPlayerGetSpeed(PLVPlayerPtr player);
453
460PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetSubtitleCount(PLVPlayerPtr player);
461
471PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetSubtitleName(PLVPlayerPtr player, int index, char name[PLV_MAX_NAME_LENGTH]);
472
481PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentSubtitle(PLVPlayerPtr player, char name[PLV_MAX_NAME_LENGTH]);
482
491PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetCurrentSubtitle(PLVPlayerPtr player, const char *name);
492
501PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetSubtitleConfig(PLVPlayerPtr player, PLVSubtitleConfigInfo &config);
502
511PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSubtitleConfig(PLVPlayerPtr player, const PLVSubtitleConfigInfo *config);
512
521PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentAudioDevice(PLVPlayerPtr player,
522 char deviceId[PLV_MAX_DEVICE_ID_LENGTH]);
531PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetCurrentAudioDevice(PLVPlayerPtr player,
532 const char deviceId[PLV_MAX_DEVICE_ID_LENGTH]);
541PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerExperimentalAPI(PLVPlayerPtr player, const char *json);
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetSubtitleName(PLVPlayerPtr player, int index, char name[PLV_MAX_NAME_LENGTH])
根据索引获取字幕名称,在视频加载后调用.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetDuration(PLVPlayerPtr player)
获取视频的时长.
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsLoaded(PLVPlayerPtr player)
判断视频是否加载.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSubtitleConfig(PLVPlayerPtr player, const PLVSubtitleConfigInfo *config)
设置字幕配置信息.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetVolume(PLVPlayerPtr player)
获取当前音量值.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentRate(PLVPlayerPtr player)
当前视频的清晰度.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetPropertyHandler(PLVPlayerPtr player, OnPlayerPropertyHandler handler, void *data)
设置播放属性值的回调通知.
void(* OnPlayerProgressHandler)(const char *vid, int millisecond, void *data)
播放进度的回调通知.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSpeed(PLVPlayerPtr player, double speed)
倍速播放, 通过作为参数给定的系数来减慢或加快播放速度.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPlayLocal(PLVPlayerPtr player, int seekMillisecond, bool autoDownRate)
离线播放. 调用前必须设置视频的存放地址.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerExperimentalAPI(PLVPlayerPtr player, const char *json)
调用实验性API.
PLAYERSDK_API PLVPlayerPtr PLAYERSDK_CALL PLVPlayerCreate(void *window)
创建播放对象并返回对象指针. 在使用播放接口对象前, 必须先调用此接口创建对象.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetCurrentAudioDevice(PLVPlayerPtr player, const char deviceId[PLV_MAX_DEVICE_ID_LENGTH])
设置当前扬声器设备标识.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSeek(PLVPlayerPtr player, int millisecond)
跳转到指定的播放位置.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVideoFrameHandler(PLVPlayerPtr player, OnPlayerVideoFrameHandler lockHandler, OnPlayerVideoFrameHandler unlockHandler, void *data)
设置播放视频帧的回调通知.
PLAYERSDK_API double PLAYERSDK_CALL PLVPlayerGetSpeed(PLVPlayerPtr player)
获取视频播放倍数.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetLogoText(PLVPlayerPtr player, bool enable, const PLVLogoTextInfo *config)
设置 LOGO 信息
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetProgressHandler(PLVPlayerPtr player, OnPlayerProgressHandler handler, void *data)
设置播放进度的回调通知.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSeekToEnd(PLVPlayerPtr player)
停止在最后一帧.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentAudioDevice(PLVPlayerPtr player, char deviceId[PLV_MAX_DEVICE_ID_LENGTH])
获取当前扬声器设备标识.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPlay(PLVPlayerPtr player, const char *token, int seekMillisecond, bool autoDownRate)
播放视频.
void(* OnPlayerPropertyHandler)(const char *vid, int property, int format, const char *value, void *data)
播放属性值的回调通知.
void(* OnPlayerRateChangeHandler)(const char *vid, int inputRate, int realRate, void *data)
播放清晰度的回调通知. 此回调的场景在:
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetAudioPlayErrorHandler(PLVPlayerPtr player, OnPlayerAudioPlayErrorHandler handler, void *data)
设置音频播放错误回调.
void(* OnPlayerStateHandler)(const char *vid, int state, void *data)
播放状态的回调通知.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVolume(PLVPlayerPtr player, int volume)
设置播放声音.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerScreenshot(PLVPlayerPtr player, const char *filename)
视频截屏.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetMute(PLVPlayerPtr player, bool mute)
设置是否静音状态.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSeekCacheEnable(PLVPlayerPtr player, bool enable)
Seek是否优先使用播放缓存.
void(* OnPlayerAudioPlayErrorHandler)(const char *vid, void *data)
音频播放错误回调.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetOSDConfig(PLVPlayerPtr player, bool enable, const PLVOsdConfigInfo *config)
设置跑马灯信息
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsValid(PLVPlayerPtr player)
判断是否加载还是空闲状态.
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsMute(PLVPlayerPtr player)
判断是否静音状态.
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsPlaying(PLVPlayerPtr player)
判断是否播放中.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetSubtitleConfig(PLVPlayerPtr player, PLVSubtitleConfigInfo &config)
获取字幕配置信息.
bool(* OnPlayerVideoFrameHandler)(const char *vid, PLVVideoFrame *frame, void *data)
播放视频帧的回调通知.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetSubtitleCount(PLVPlayerPtr player)
获取当前视频的可用字幕数量,在视频加载后调用.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetOSDConfig(PLVPlayerPtr player, PLVOsdConfigInfo &config)
获取跑马灯信息.
PLAYERSDK_API void PLAYERSDK_CALL PLVPlayerDestroy(PLVPlayerPtr player)
销毁播放对象. 不再使用创建的对象后, 必须调用此接口回收.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetCacheConfig(PLVPlayerPtr player, bool enable, int maxCacheBytes, int maxCacheSeconds)
设置播放缓存信息.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerResetHandler(PLVPlayerPtr player)
重置所有回调通知, 会请空所有的回调函数地址.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetCurrentSubtitle(PLVPlayerPtr player, const char *name)
设置当前字幕.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetLogoText(PLVPlayerPtr player, PLVLogoTextInfo &config)
获取 LOGO 信息.
void * PLVPlayerPtr
播放对象, 每一个播放对象同时只能播放一个视频, 可以创建多个播放对象.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerStop(PLVPlayerPtr player)
停止播放.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetStateHandler(PLVPlayerPtr player, OnPlayerStateHandler handler, void *data)
设置播放状态的回调通知.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentSubtitle(PLVPlayerPtr player, char name[PLV_MAX_NAME_LENGTH])
获取当前字幕.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPause(PLVPlayerPtr player, bool pause)
设置是否暂停状态.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetInfo(PLVPlayerPtr player, const char *vid, const char *path, int rate)
设置视频信息. 在调用播放前, 必须先设置视频的相关信息, 否则会报错.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentRateCount(PLVPlayerPtr player)
获取视频的清晰度总数.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCacheConfig(PLVPlayerPtr player, int *maxCacheBytes, int *maxCacheSeconds)
获取缓存信息.
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsPause(PLVPlayerPtr player)
判断是否暂停状态.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetRateChangeHandler(PLVPlayerPtr player, OnPlayerRateChangeHandler handler, void *data)
设置清晰度变化的回调通知. 只有输入清度为 VIDEO_RATE_AUTO 才会触发此回调.
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsLoading(PLVPlayerPtr player)
判断视频是否加载中.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVolumeMax(PLVPlayerPtr player, int volume)
设置声音增益.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerLoadLocal(PLVPlayerPtr player, int seekMillisecond, bool autoDownRate)
离线加载视频, 不自动播放. 调用前必须设置视频的存放地址.
const int PLV_MAX_NAME_LENGTH
const int PLV_MAX_DEVICE_ID_LENGTH