AliyunPlayer  v5.2.0
Aliyun Player API Reference Manual for Windows Platforms
alivc_player::AliPlayer Class Referenceabstract

Public Member Functions

virtual void addExtSubtitle (const char *URL)=0
 Add external subtitles. More...
 
virtual void destroy ()=0
 Delete the player. More...
 
virtual void enableHardwareDecoder (bool bEnabled)=0
 Enable or disable hardware decoding. More...
 
virtual int64_t getBufferedPosition ()=0
 Query the buffered position. More...
 
virtual const char * getCacheFilePath (const char *URL)=0
 Query the name of the cached file with the specified URL. More...
 
virtual const char * getCacheFilePath (const char *vid, const char *format, const char *definition, int previewTime)=0
 Query the name of the cached file with the specified URL. More...
 
virtual AVPConfiggetConfig ()=0
 Query player configuration. More...
 
virtual int64_t getCurrentPosition ()=0
 Query the current playback position. More...
 
virtual AVPTrackInfo getCurrentTrack (AVPTrackType type)=0
 Query the track that is being played. More...
 
virtual int64_t getDuration ()=0
 Query the length of the video. More...
 
virtual int getHeight ()=0
 Query the height of the video. More...
 
virtual IAVPListenergetListener ()=0
 get listener More...
 
virtual int64_t getMasterClockPts ()=0
 get master clock pts More...
 
virtual AVPMediaInfo getMediaInfo ()=0
 Query media information, including track information. More...
 
virtual AVPMirrorMode getMirrorMode ()=0
 Query mirroring mode. More...
 
virtual float getRate ()=0
 Query the playback speed. More...
 
virtual AVPRotateMode getRotateMode ()=0
 Query rotate mode. More...
 
virtual int getRotation ()=0
 Query the rotate angle of the video, which is retrieved from the video metadata. More...
 
virtual AVPScalingMode getScalingMode ()=0
 Query zoom mode. More...
 
virtual void getThumbnail (int64_t positionMs)=0
 Retrieve the thumbnail image at the specified position. More...
 
virtual void * getView ()=0
 
virtual float getVolume ()=0
 Query the volume of the player(Not system volume). More...
 
virtual int getWidth ()=0
 Query the width of the video. More...
 
virtual bool isAutoPlay ()=0
 Query whether enableautoplay. More...
 
virtual bool isEnabledHardwareDecoder ()=0
 Query whether enable hardware decoding. More...
 
virtual bool isLoop ()=0
 Query whether enable loop playback. More...
 
virtual bool isMuted ()=0
 Get mute status. More...
 
virtual void pause ()=0
 Pause. More...
 
virtual void prepare ()=0
 Prepare for playback. More...
 
virtual void redraw ()=0
 Refresh the view in certain situations, for example, when the size of the view changes. More...
 
virtual void reset ()=0
 Reset. More...
 
virtual void seekToTime (int64_t time, AVPSeekMode seekMode)=0
 Seek to a specified position. More...
 
virtual void selectExtSubtitle (int trackIndex, bool enable)=0
 Select external subtitles. More...
 
virtual void selectTrack (int trackIndex)=0
 Switch definition according to the specified track index. More...
 
virtual void setAudioRenderingCallback (AudioRenderingCallback func, void *userData)=0
 Set a audio rendering callback block. More...
 
virtual void setAutoPlay (bool bAutoPlay)=0
 Enable or disable autoplay. More...
 
virtual bool setCacheConfig (AVPCacheConfig *cacheConfig)=0
 Modify cache configuration. More...
 
virtual void setConfig (AVPConfig *config)=0
 Modify player configuration. More...
 
virtual void setListener (IAVPListener *listener)=0
 set listener More...
 
virtual void setLoop (bool bLoop)=0
 Enable or disable loop playback. More...
 
virtual void setMirrorMode (AVPMirrorMode mirrorMode)=0
 Set a mirroring mode. More...
 
virtual void setMute (bool muted)=0
 Mute or unmute the player. More...
 
virtual void setRate (float rate)=0
 Set the playback speed. More...
 
virtual void setRotateMode (AVPRotateMode rotateMode)=0
 Set a rotate mode. More...
 
virtual void setScalingMode (AVPScalingMode scalingMode)=0
 Set a zoom mode. More...
 
virtual void setSource (const AVPUrlSource &source)=0
 Play by URL. More...
 
virtual void setSource (const AVPVidAuthSource &source)=0
 Play by VID and playauth. More...
 
virtual void setSource (const AVPVidMpsSource &source)=0
 Play by VID and MPS. More...
 
virtual void setSource (const AVPVidStsSource &source)=0
 Play by VID and STS. More...
 
virtual void setTraceID (const char *traceID)=0
 Set a trace ID for debugging. More...
 
virtual void setVideoRenderingCallback (VideoRenderingCallback func, void *userData)=0
 Set a video rendering callback block. More...
 
virtual void setView (void *view)=0
 Set a player view (playerView). More...
 
virtual void setVolume (float volume)=0
 Set the volume of the player(Not system volume). More...
 
virtual void snapshot ()=0
 Snapshot. More...
 
virtual void start ()=0
 Start playing. More...
 
virtual void stop ()=0
 Stop. More...
 
virtual ~AliPlayer ()=default
 

Static Public Member Functions

static void alivcFree (void *buffer)
 free memory allocate by sdk More...
 
static AliPlayerCreatePlayer ()
 
static void enableLog (AVPLogLevel level)
 set the level of the log. More...
 
static const char * getSDKVersion ()
 Query the SDK version. More...
 
static void setLogCallback (ApsaraPlayerLogCallback func, void *arg)
 Set a log output callback block. More...
 

Constructor & Destructor Documentation

◆ ~AliPlayer()

virtual alivc_player::AliPlayer::~AliPlayer ( )
virtualdefault

Member Function Documentation

◆ addExtSubtitle()

virtual void alivc_player::AliPlayer::addExtSubtitle ( const char *  URL)
pure virtual

Add external subtitles.

Parameters
URLsubtitle address

◆ alivcFree()

static void alivc_player::AliPlayer::alivcFree ( void *  buffer)
static

free memory allocate by sdk

See also
getCacheFilePath

◆ CreatePlayer()

static AliPlayer* alivc_player::AliPlayer::CreatePlayer ( )
static

◆ destroy()

virtual void alivc_player::AliPlayer::destroy ( )
pure virtual

Delete the player.

◆ enableHardwareDecoder()

virtual void alivc_player::AliPlayer::enableHardwareDecoder ( bool  bEnabled)
pure virtual

Enable or disable hardware decoding.

◆ enableLog()

static void alivc_player::AliPlayer::enableLog ( AVPLogLevel  level)
static

set the level of the log.

◆ getBufferedPosition()

virtual int64_t alivc_player::AliPlayer::getBufferedPosition ( )
pure virtual

Query the buffered position.

◆ getCacheFilePath() [1/2]

virtual const char* alivc_player::AliPlayer::getCacheFilePath ( const char *  URL)
pure virtual

Query the name of the cached file with the specified URL.

If the delegation failed, the default logic is used to generate the file name.

Parameters
URLThe URL of the cached file.
Returns
The name of the cached file. The file extension is not included. All files use the .alv extension. should be freed width alivcFree()

◆ getCacheFilePath() [2/2]

virtual const char* alivc_player::AliPlayer::getCacheFilePath ( const char *  vid,
const char *  format,
const char *  definition,
int  previewTime 
)
pure virtual

Query the name of the cached file with the specified URL.

Parameters
vidThe VID of the video.
formatThe format of the video.
definitionThe definition of the video.
previewTimeThe preview duration of the video. if 0, ignore this param
Returns
The name of the cached file. The file extension is not included. All files use the .alv extension.should be freed width alivcFree()

◆ getConfig()

virtual AVPConfig* alivc_player::AliPlayer::getConfig ( )
pure virtual

Query player configuration.

See also
AVPConfig

◆ getCurrentPosition()

virtual int64_t alivc_player::AliPlayer::getCurrentPosition ( )
pure virtual

Query the current playback position.

◆ getCurrentTrack()

virtual AVPTrackInfo alivc_player::AliPlayer::getCurrentTrack ( AVPTrackType  type)
pure virtual

Query the track that is being played.

Parameters
typeTrack type.
See also
AVPTrackType

◆ getDuration()

virtual int64_t alivc_player::AliPlayer::getDuration ( )
pure virtual

Query the length of the video.

◆ getHeight()

virtual int alivc_player::AliPlayer::getHeight ( )
pure virtual

Query the height of the video.

◆ getListener()

virtual IAVPListener* alivc_player::AliPlayer::getListener ( )
pure virtual

get listener

◆ getMasterClockPts()

virtual int64_t alivc_player::AliPlayer::getMasterClockPts ( )
pure virtual

get master clock pts

◆ getMediaInfo()

virtual AVPMediaInfo alivc_player::AliPlayer::getMediaInfo ( )
pure virtual

Query media information, including track information.

◆ getMirrorMode()

virtual AVPMirrorMode alivc_player::AliPlayer::getMirrorMode ( )
pure virtual

Query mirroring mode.

See also
AVPMirrorMode

◆ getRate()

virtual float alivc_player::AliPlayer::getRate ( )
pure virtual

Query the playback speed.

◆ getRotateMode()

virtual AVPRotateMode alivc_player::AliPlayer::getRotateMode ( )
pure virtual

Query rotate mode.

See also
AVPRotateMode

◆ getRotation()

virtual int alivc_player::AliPlayer::getRotation ( )
pure virtual

Query the rotate angle of the video, which is retrieved from the video metadata.

◆ getScalingMode()

virtual AVPScalingMode alivc_player::AliPlayer::getScalingMode ( )
pure virtual

Query zoom mode.

See also
AVPScalingMode

◆ getSDKVersion()

static const char* alivc_player::AliPlayer::getSDKVersion ( )
static

Query the SDK version.

◆ getThumbnail()

virtual void alivc_player::AliPlayer::getThumbnail ( int64_t  positionMs)
pure virtual

Retrieve the thumbnail image at the specified position.

Parameters
positionMsThe specified position.

◆ getView()

virtual void* alivc_player::AliPlayer::getView ( )
pure virtual

◆ getVolume()

virtual float alivc_player::AliPlayer::getVolume ( )
pure virtual

Query the volume of the player(Not system volume).

◆ getWidth()

virtual int alivc_player::AliPlayer::getWidth ( )
pure virtual

Query the width of the video.

◆ isAutoPlay()

virtual bool alivc_player::AliPlayer::isAutoPlay ( )
pure virtual

Query whether enableautoplay.

◆ isEnabledHardwareDecoder()

virtual bool alivc_player::AliPlayer::isEnabledHardwareDecoder ( )
pure virtual

Query whether enable hardware decoding.

◆ isLoop()

virtual bool alivc_player::AliPlayer::isLoop ( )
pure virtual

Query whether enable loop playback.

◆ isMuted()

virtual bool alivc_player::AliPlayer::isMuted ( )
pure virtual

Get mute status.

◆ pause()

virtual void alivc_player::AliPlayer::pause ( )
pure virtual

Pause.

◆ prepare()

virtual void alivc_player::AliPlayer::prepare ( )
pure virtual

Prepare for playback.

Asynchronous callback.

◆ redraw()

virtual void alivc_player::AliPlayer::redraw ( )
pure virtual

Refresh the view in certain situations, for example, when the size of the view changes.

◆ reset()

virtual void alivc_player::AliPlayer::reset ( )
pure virtual

Reset.

◆ seekToTime()

virtual void alivc_player::AliPlayer::seekToTime ( int64_t  time,
AVPSeekMode  seekMode 
)
pure virtual

Seek to a specified position.

Parameters
timeThe specified position that the player will seek to, Unit: millisecond.
seekModeSeek mode.
See also
AVPSeekMode

◆ selectExtSubtitle()

virtual void alivc_player::AliPlayer::selectExtSubtitle ( int  trackIndex,
bool  enable 
)
pure virtual

Select external subtitles.

Parameters
trackIndexcaption index
enabletrue: select, false: close

◆ selectTrack()

virtual void alivc_player::AliPlayer::selectTrack ( int  trackIndex)
pure virtual

Switch definition according to the specified track index.

Parameters
trackIndexSpecify a definition index. SELECT_AVPTRACK_TYPE_VIDEO_AUTO: auto bitrate adjustment.

◆ setAudioRenderingCallback()

virtual void alivc_player::AliPlayer::setAudioRenderingCallback ( AudioRenderingCallback  func,
void *  userData 
)
pure virtual

Set a audio rendering callback block.

◆ setAutoPlay()

virtual void alivc_player::AliPlayer::setAutoPlay ( bool  bAutoPlay)
pure virtual

Enable or disable autoplay.

◆ setCacheConfig()

virtual bool alivc_player::AliPlayer::setCacheConfig ( AVPCacheConfig cacheConfig)
pure virtual

Modify cache configuration.

Parameters
AVPCacheConfigCache configuration. AVPCacheConfig.
Returns
If the cache configuration is modified, YES is returned.

◆ setConfig()

virtual void alivc_player::AliPlayer::setConfig ( AVPConfig config)
pure virtual

Modify player configuration.

Parameters
configAVPConfig type.
See also
AVPConfig

◆ setListener()

virtual void alivc_player::AliPlayer::setListener ( IAVPListener listener)
pure virtual

set listener

◆ setLogCallback()

static void alivc_player::AliPlayer::setLogCallback ( ApsaraPlayerLogCallback  func,
void *  arg 
)
static

Set a log output callback block.

Asynchronous.

◆ setLoop()

virtual void alivc_player::AliPlayer::setLoop ( bool  bLoop)
pure virtual

Enable or disable loop playback.

◆ setMirrorMode()

virtual void alivc_player::AliPlayer::setMirrorMode ( AVPMirrorMode  mirrorMode)
pure virtual

Set a mirroring mode.

See also
AVPMirrorMode

◆ setMute()

virtual void alivc_player::AliPlayer::setMute ( bool  muted)
pure virtual

Mute or unmute the player.

◆ setRate()

virtual void alivc_player::AliPlayer::setRate ( float  rate)
pure virtual

Set the playback speed.

Valid values: 0.5 to 2.0. Value 1 indicates normal speed

◆ setRotateMode()

virtual void alivc_player::AliPlayer::setRotateMode ( AVPRotateMode  rotateMode)
pure virtual

Set a rotate mode.

See also
AVPRotateMode

◆ setScalingMode()

virtual void alivc_player::AliPlayer::setScalingMode ( AVPScalingMode  scalingMode)
pure virtual

Set a zoom mode.

See also
AVPScalingMode

◆ setSource() [1/4]

virtual void alivc_player::AliPlayer::setSource ( const AVPUrlSource source)
pure virtual

Play by URL.

Parameters
sourceAVPUrlSource type.
See also
AVPUrlSource

◆ setSource() [2/4]

virtual void alivc_player::AliPlayer::setSource ( const AVPVidAuthSource source)
pure virtual

Play by VID and playauth.

See https://help.aliyun.com/document_detail/57294.html

Parameters
sourceAVPVidAuthSource type.
See also
AVPVidAuthSource

◆ setSource() [3/4]

virtual void alivc_player::AliPlayer::setSource ( const AVPVidMpsSource source)
pure virtual

Play by VID and MPS.

See https://help.aliyun.com/document_detail/53522.html

Parameters
sourceAVPVidMpsSource type.
See also
AVPVidMpsSource

◆ setSource() [4/4]

virtual void alivc_player::AliPlayer::setSource ( const AVPVidStsSource source)
pure virtual

Play by VID and STS.

For STS, see https://help.aliyun.com/document_detail/28756.html

Parameters
sourceAVPVidStsSource type.
See also
AVPVidStsSource

◆ setTraceID()

virtual void alivc_player::AliPlayer::setTraceID ( const char *  traceID)
pure virtual

Set a trace ID for debugging.

Parameters
traceIDThe specified client connection trace ID.

◆ setVideoRenderingCallback()

virtual void alivc_player::AliPlayer::setVideoRenderingCallback ( VideoRenderingCallback  func,
void *  userData 
)
pure virtual

Set a video rendering callback block.

◆ setView()

virtual void alivc_player::AliPlayer::setView ( void *  view)
pure virtual

Set a player view (playerView).

view: windows platform: HWND.

◆ setVolume()

virtual void alivc_player::AliPlayer::setVolume ( float  volume)
pure virtual

Set the volume of the player(Not system volume).

The range is 0.0~2.0,it maybe lead to noise if set volume more then 1.0, not recommended.

◆ snapshot()

virtual void alivc_player::AliPlayer::snapshot ( )
pure virtual

Snapshot.

data will be returned in onSnapshotImageBuffer callback

◆ start()

virtual void alivc_player::AliPlayer::start ( )
pure virtual

Start playing.

◆ stop()

virtual void alivc_player::AliPlayer::stop ( )
pure virtual

Stop.


The documentation for this class was generated from the following file: