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

Typedefs

typedef void(* OnLogMessageHandler) (LOG_FILTER_TYPE level, const char *message, void *data)
 log message callback.
 
typedef void(* OnRequestVideoInfoHandler) (int code, const PLVVideoRequestInfo infos[], int infosNum, const PLVVideoRequestPageInfo *pageInfo, void *data)
 request video info callback.
 

Functions

PLAYERSDK_API const char *PLAYERSDK_CALL PLVGetSdkVersion (void)
 get the sdk version.
 
PLAYERSDK_API const char *PLAYERSDK_CALL PLVGetSdkErrorDescription (int err)
 get the code description.
 
PLAYERSDK_API bool PLAYERSDK_CALL PLVCheckFileComplete (const char *vid, const char *videoFilePath, int rate)
 check the video is completed.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkLogLevel (LOG_FILTER_TYPE level)
 set the sdk log filter level.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkLogFile (const char *fileName)
 set the sdk log file.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkLogMessageCallback (bool enable, OnLogMessageHandler handler, void *data)
 for log message callback.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkHttpRequest (SDK_HTTP_REQUEST type)
 for thd sdk http request type.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkCacertFile (const char *fileName)
 set upload ca file, if use https, must set the ca file, otherwise error.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkHwdecEnable (bool enable)
 Hardware coding.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkKeepLastFrame (bool enable)
 end video will keep in last frame.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkRetryAttempts (int attempts, int milliseconds, int millisecondsMax)
 download retry count, default unlimit retry
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkVideoOutputDevice (VIDEO_OUTPUT_DEVICE type, const char *context=NULL)
 Video output drivers are interfaces to different video output facilities. If there is no video problem, it is generally not recommended to use.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkViewerInfo (const char *viewerId, const char *viewerName, const char *viewerAvatar, const char *viewerExtraInfo1=NULL, const char *viewerExtraInfo2=NULL, const char *viewerExtraInfo3=NULL)
 this api will use report qos, recommended settings.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkSeed (const char *seed)
 set decryption seed.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkLocalRememberPlay (bool enable)
 Set the last playback position for playback.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVInitSdkLibrary (const PLVAccountInfo *info)
 init the sdk.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVRequestVideoInfo (bool sync, const PLVVideoRequestParam *param, OnRequestVideoInfoHandler handler, void *data)
 request video info.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVCancelRequestVideoInfo ()
 cancel request video info.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVMigrateLocalVideoKeyFile (const char *keyFilePath, const char *secretKey)
 migrate old encryption key to use token encryption key.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVDeleteLocalVideoFile (const char *vid, const char *path, int rate)
 delete local video file.
 
PLAYERSDK_API void PLAYERSDK_CALL PLVReleaseSdkLibrary (void)
 release sdk.
 

Detailed Description

Typedef Documentation

◆ OnLogMessageHandler

typedef void(* OnLogMessageHandler) (LOG_FILTER_TYPE level, const char *message, void *data)

log message callback.

Parameters
[out]levelthe log level.
See also
LOG_FILTER_TYPE.
Parameters
[out]messagelog message.
[out]datauser context data.

Definition at line 64 of file plv-player-core.h.

◆ OnRequestVideoInfoHandler

typedef void(* OnRequestVideoInfoHandler) (int code, const PLVVideoRequestInfo infos[], int infosNum, const PLVVideoRequestPageInfo *pageInfo, void *data)

request video info callback.

Parameters
[out]coderequest result code
[out]infosvideo infos.
[out]infosNumvideo infos number.
[out]pageInfopage info, if user request in page.
[out]datauser context.

Definition at line 204 of file plv-player-core.h.

Function Documentation

◆ PLVCancelRequestVideoInfo()

PLAYERSDK_API int PLAYERSDK_CALL PLVCancelRequestVideoInfo ( )

cancel request video info.

Deprecated
Suggest requesting video information on the server
Returns
  • 0: Success.
  • > 0: Failure.
Note
need SDK init.

◆ PLVCheckFileComplete()

PLAYERSDK_API bool PLAYERSDK_CALL PLVCheckFileComplete ( const char * vid,
const char * videoFilePath,
int rate )

check the video is completed.

Parameters
vidthe video id.
videoFilePaththe video file path, use UTF8.
ratethe video rate.
See also
VIDEO_RATE_TYPE.
Returns
  • true: the video is complete.
  • false: the video is no complete.
Note
if the file is mp4, only check the file is exist.
Attention
path must use UTF8.

◆ PLVDeleteLocalVideoFile()

PLAYERSDK_API int PLAYERSDK_CALL PLVDeleteLocalVideoFile ( const char * vid,
const char * path,
int rate )

delete local video file.

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
if rate is VIDEO_RATE_AUTO will delete all rate file.
Note
need SDK init.

◆ PLVGetSdkErrorDescription()

PLAYERSDK_API const char *PLAYERSDK_CALL PLVGetSdkErrorDescription ( int err)

get the code description.

Parameters
errerror code
See also
SDK_ERROR_TYPE.
Returns
  • string: description of the error code.

◆ PLVGetSdkVersion()

PLAYERSDK_API const char *PLAYERSDK_CALL PLVGetSdkVersion ( void )

get the sdk version.

Returns
  • string: SDK version.

◆ PLVInitSdkLibrary()

PLAYERSDK_API int PLAYERSDK_CALL PLVInitSdkLibrary ( const PLVAccountInfo * info)

init the sdk.

Parameters
infoaccount info.
Returns
  • 0: Success.
  • > 0: Failure.

◆ PLVMigrateLocalVideoKeyFile()

PLAYERSDK_API int PLAYERSDK_CALL PLVMigrateLocalVideoKeyFile ( const char * keyFilePath,
const char * secretKey )

migrate old encryption key to use token encryption key.

Parameters
keyFilePathkey file path, use UTF8.
secretKeyold secret key.
Returns
  • 0: Success.
  • > 0: Failure.
Attention
path must use UTF8.
Note
need SDK init.

◆ PLVReleaseSdkLibrary()

PLAYERSDK_API void PLAYERSDK_CALL PLVReleaseSdkLibrary ( void )

release sdk.

◆ PLVRequestVideoInfo()

PLAYERSDK_API int PLAYERSDK_CALL PLVRequestVideoInfo ( bool sync,
const PLVVideoRequestParam * param,
OnRequestVideoInfoHandler handler,
void * data )

request video info.

Deprecated
Suggest requesting video information on the server
Parameters
syncuse sync or asynchronous.
paramrequest param.
handlercallback function.
datauser context.
Returns
  • 0: Success.
  • > 0: Failure.
Note
need SDK init.

◆ PLVSetSdkCacertFile()

PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkCacertFile ( const char * fileName)

set upload ca file, if use https, must set the ca file, otherwise error.

Deprecated
Not recommended to set the CA certificate path
Parameters
fileNamethe ca file,include path. use UTF8.
Returns
  • 0: Success.
  • > 0: Failure.
Note
if not have call, will find in app path.
Attention
path must use UTF8

◆ PLVSetSdkHttpRequest()

PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkHttpRequest ( SDK_HTTP_REQUEST type)

for thd sdk http request type.

Deprecated
Not recommended to set the HTTP request type
Parameters
typehttp protocol first request type.
See also
ONLY_HTTPS_REQUEST.
Returns
  • 0: Success.
  • > 0: Failure.
Note
default value for ONLY_HTTPS_REQUEST.

◆ PLVSetSdkHwdecEnable()

PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkHwdecEnable ( bool enable)

Hardware coding.

Parameters
enablevideo hardware acceleration enable.
Returns
  • 0: Success.
  • > 0: Failure.
Note
default off
Attention
turning on hardware acceleration under vrm13 may cause a splash screen.

◆ PLVSetSdkKeepLastFrame()

PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkKeepLastFrame ( bool enable)

end video will keep in last frame.

Parameters
enableopen or no.
Returns
  • 0: Success.
  • > 0: Failure.
Note
if not have call will default false.

◆ PLVSetSdkLocalRememberPlay()

PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkLocalRememberPlay ( bool enable)

Set the last playback position for playback.

Parameters
enableuse local record, use last time the playback position, default true.
Returns
  • 0: Success.
  • > 0: Failure.

◆ PLVSetSdkLogFile()

PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkLogFile ( const char * fileName)

set the sdk log file.

Parameters
fileNamethe log file, include path, use UTF8.
Returns
  • 0: Success.
  • > 0: Failure.
Note
if not invoke, will create in %appdata%%/plv-player-sdk/logs/.
Attention
path must use UTF8.

◆ PLVSetSdkLogLevel()

PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkLogLevel ( LOG_FILTER_TYPE level)

set the sdk log filter level.

Parameters
levelthe log level.
See also
LOG_FILTER_TYPE.
Returns
  • 0: Success.
  • > 0: Failure.
Note
default value for LOG_FILTER_INFO.

◆ PLVSetSdkLogMessageCallback()

PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkLogMessageCallback ( bool enable,
OnLogMessageHandler handler,
void * data )

for log message callback.

Parameters
enablefor check to callback or not.
handlercallback function.
datauser context data.
Returns
  • 0: Success.
  • > 0: Failure.

◆ PLVSetSdkRetryAttempts()

PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkRetryAttempts ( int attempts,
int milliseconds,
int millisecondsMax )

download retry count, default unlimit retry

Parameters
attemptsattempt to retry download. default unlimit(-1).
millisecondsdelay to retry time. default 500 ms.
millisecondsMaxdelay max value. default 25000 ms.
Returns
  • 0: Success.
  • > 0: Failure.

◆ PLVSetSdkSeed()

PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkSeed ( const char * seed)

set decryption seed.

Parameters
seeddecryption seed.
Returns
  • 0: Success.
  • > 0: Failure.
Attention
in vrm12/vrm13 online play, If seed is set when requesting a token, then seed also needs to be set before playback.

◆ PLVSetSdkVideoOutputDevice()

PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkVideoOutputDevice ( VIDEO_OUTPUT_DEVICE type,
const char * context = NULL )

Video output drivers are interfaces to different video output facilities. If there is no video problem, it is generally not recommended to use.

Parameters
typeoutput type.
See also
VIDEO_OUTPUT_DEVICE.
Parameters
contextit can be "auto, d3d11, win, angle, dxinterop".
Returns
  • 0: Success.
  • > 0: Failure.
Note
  • type for VIDEO_OUTPUT_GPU, the context can set value.
Sample
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkVideoOutputDevice(VIDEO_OUTPUT_DEVICE type, const char *context=NULL)
Video output drivers are interfaces to different video output facilities. If there is no video proble...
@ VIDEO_OUTPUT_GPU

◆ PLVSetSdkViewerInfo()

PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkViewerInfo ( const char * viewerId,
const char * viewerName,
const char * viewerAvatar,
const char * viewerExtraInfo1 = NULL,
const char * viewerExtraInfo2 = NULL,
const char * viewerExtraInfo3 = NULL )

this api will use report qos, recommended settings.

Parameters
viewerIduser custom viewer id, use in location quality.
viewerNameuser custom viewer name.
viewerAvataruser custom viewer avatar.
viewerExtraInfo1extend field.
viewerExtraInfo2extend field.
viewerExtraInfo3extend field.
Returns
  • 0: Success.
  • > 0: Failure.
Attention
in vrm12/vrm13,must set it, otherwise will play fail.