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.
 

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 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 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 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 PLVSetSdkLocalRememberPlay (bool enable)
 Set the last playback position for playback.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVSetSdkRetryAttempts (int attempts, int milliseconds, int millisecondsMax)
 download retry count, default unlimit retry
 
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, only used in vod.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVInitSdkLibrary (const PLVAccountInfo *info)
 init the sdk.
 
PLAYERSDK_API void PLAYERSDK_CALL PLVReleaseSdkLibrary (void)
 release sdk.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVDeleteLocalVideoFile (const char *vid, const char *path, int rate)
 delete local video file.
 
PLAYERSDK_API bool PLAYERSDK_CALL PLVCheckFileComplete (const char *vid, const char *videoFilePath, int rate)
 check the video is completed.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVGetAudioDeviceCount ()
 get audio device count.
 
PLAYERSDK_API int PLAYERSDK_CALL PLVGetAudioDeviceInfo (int index, char deviceId[PLV_MAX_DEVICE_ID_LENGTH], char deviceName[PLV_MAX_DEVICE_ID_LENGTH])
 the audio device info.
 

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 54 of file plv-player-core.h.

Function Documentation

◆ 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.

◆ PLVGetAudioDeviceCount()

PLAYERSDK_API int PLAYERSDK_CALL PLVGetAudioDeviceCount ( )

get audio device count.

Returns
  • >=0 audio device count.
Note
need a short period of time after SDK init.

◆ PLVGetAudioDeviceInfo()

PLAYERSDK_API int PLAYERSDK_CALL PLVGetAudioDeviceInfo ( int index,
char deviceId[PLV_MAX_DEVICE_ID_LENGTH],
char deviceName[PLV_MAX_DEVICE_ID_LENGTH] )

the audio device info.

Parameters
indexaudio device index.
[out]deviceIdaudio device id.
[out]deviceNameaudio device name.
Returns
  • 0: Success.
  • > 0: Failure.
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.

◆ PLVReleaseSdkLibrary()

PLAYERSDK_API void PLAYERSDK_CALL PLVReleaseSdkLibrary ( void )

release sdk.

◆ 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, only used in vod.

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.