AliyunPlayer  v4.7.1
Aliyun Player API Reference Manual for iOS Platforms
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties
AliPlayer Class Reference
Inheritance diagram for AliPlayer:
AliListPlayer AVPLiveTimeShift

Instance Methods

(void) - destroy
 Delete the player. More...
 
(NSString *) - getCacheFilePath:
 Query the name of the cached file with the specified URL. More...
 
(NSString *) - getCacheFilePath:format:definition:
 Query the name of the cached file with the specified URL. More...
 
(NSString *) - getCacheFilePath:format:definition:previewTime:
 Query the name of the cached file with the specified URL. More...
 
(AVPConfig *) - getConfig
 Query player configuration. More...
 
(AVPTrackInfo *) - getCurrentTrack:
 Query the track that is being played. More...
 
(AVPMediaInfo *) - getMediaInfo
 Query media information, including track information. More...
 
(NSString *) - getPropertyString:
 Get information by key. More...
 
(void) - getThumbnail:
 Retrieve the thumbnail image at the specified position. More...
 
(instancetype) - init
 Initialize the player. More...
 
(instancetype) - init:
 Initialize the player. More...
 
(void) - pause
 Pause. More...
 
(void) - prepare
 Prepare for playback. More...
 
(void) - redraw
 Refresh the view in certain situations, for example, when the size of the view changes. More...
 
(void) - reload
 Reload resources. More...
 
(void) - reset
 Reset. More...
 
(void) - seekToTime:seekMode:
 Seek to a specified position. More...
 
(void) - selectTrack:
 Switch definition according to the specified track index. More...
 
(void) - setAuthSource:
 Play by VID and playauth. More...
 
(BOOL) - setCacheConfig:
 Modify cache configuration. More...
 
(void) - setConfig:
 Modify player configuration. More...
 
(void) - setMpsSource:
 Play by VID and MPS. More...
 
(void) - setPlayUrlConvertCallback:
 Set a URL conversion callback. More...
 
(void) - setStsSource:
 Play by VID and STS. More...
 
(void) - setThumbnailUrl:
 Specify a thumbnail image URL. More...
 
(void) - setTraceID:
 Set a trace ID for debugging. More...
 
(void) - setUrlSource:
 Play by URL. More...
 
(void) - snapShot
 Snapshot. More...
 
(void) - start
 Start playing. More...
 
(void) - stop
 Stop. More...
 

Class Methods

(NSString *) + getSDKVersion
 Query the SDK version. More...
 
(void) + initPlayerComponent:function:
 Initialize player components. More...
 
(void) + setLogCallbackInfo:callbackBlock:
 Set a log output callback block. More...
 

Properties

BOOL autoPlay
 Enable or disable autoplay. More...
 
int64_t bufferedPosition
 Query the buffered position. More...
 
int64_t currentPosition
 Query the current playback position. More...
 
id< AVPDelegatedelegate
 Set a proxy. More...
 
int64_t duration
 Query the length of the video. More...
 
BOOL enableHardwareDecoder
 Enable or disable hardware decoding. More...
 
BOOL enableLog
 Enable or disable logging. More...
 
int height
 Query the height of the video. More...
 
BOOL loop
 Enable or disable loop playback. More...
 
AVPMirrorMode mirrorMode
 Set a mirroring mode. More...
 
BOOL muted
 Mute or unmute the player. More...
 
AVPView * playerView
 Set a player view (playerView). More...
 
float rate
 Set the playback speed. More...
 
AVPRotateMode rotateMode
 Set a rotate mode. More...
 
int rotation
 Query the rotate angle of the video, which is retrieved from the video metadata. More...
 
AVPScalingMode scalingMode
 Set a zoom mode. More...
 
float volume
 Query or set the volume of the player. More...
 
int width
 Query the width of the video. More...
 

Method Documentation

◆ destroy()

- (void) destroy

Delete the player.

◆ getCacheFilePath:()

- (NSString *) getCacheFilePath: (NSString *)  URL

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

If a custom rule is set, delegate onGetCacheNameByURL. 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.

◆ getCacheFilePath:format:definition:()

- (NSString *) getCacheFilePath: (NSString *)  vid
format: (NSString *)  format
definition: (NSString *)  definition 

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

If a custom rule is set, delegate onCacheNameByVidCallback. If the delegation failed, the default logic is used to generate the file name.

Parameters
vidThe VID of the video.
formatThe format of the video.
definitionThe definition of the video.
Returns
The name of the cached file. The file extension is not included. All files use the .alv extension.

◆ getCacheFilePath:format:definition:previewTime:()

- (NSString *) getCacheFilePath: (NSString *)  vid
format: (NSString *)  format
definition: (NSString *)  definition
previewTime: (int)  previewTime 

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

If a custom rule is set, delegate onCacheNameByVidCallback. If the delegation failed, the default logic is used to generate the file name.

Parameters
vidThe VID of the video.
formatThe format of the video.
definitionThe definition of the video.
previewTimeThe preview duration of the video.
Returns
The name of the cached file. The file extension is not included. All files use the .alv extension.

◆ getConfig()

- (AVPConfig*) getConfig

Query player configuration.

See also
AVPConfig

◆ getCurrentTrack:()

- (AVPTrackInfo*) getCurrentTrack: (AVPTrackType type

Query the track that is being played.

Parameters
typeTrack type.
See also
AVPTrackType

◆ getMediaInfo()

- (AVPMediaInfo*) getMediaInfo

Query media information, including track information.

◆ getPropertyString:()

- (NSString *) getPropertyString: (AVPPropertyKey key

Get information by key.

Parameters
keyThe enum of key
Returns
corresponding information, return "" if doesn't exist.

◆ getSDKVersion()

+ (NSString*) getSDKVersion

Query the SDK version.

◆ getThumbnail:()

- (void) getThumbnail: (int64_t)  positionMs

Retrieve the thumbnail image at the specified position.

Parameters
positionMsThe specified position.

◆ init()

- (instancetype) init

Initialize the player.

Implemented in AliListPlayer.

◆ init:()

- (instancetype) init: (NSString *)  traceID

Initialize the player.

Parameters
traceIDA trace ID for debugging.

Implemented in AliListPlayer.

◆ initPlayerComponent:function:()

+ (void) initPlayerComponent: (NSString *)  functionName
function: (void *)  function 

Initialize player components.

These components are optional. You can remove these components by deleting the dynamic libraries and code of the components on your app.

◆ pause()

- (void) pause

Pause.

◆ prepare()

- (void) prepare

Prepare for playback.

Asynchronous callback.

◆ redraw()

- (void) redraw

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

◆ reload()

- (void) reload

Reload resources.

You can reload resources when the network connection times out.

◆ reset()

- (void) reset

Reset.

◆ seekToTime:seekMode:()

- (void) seekToTime: (int64_t)  time
seekMode: (AVPSeekMode seekMode 

Seek to a specified position.

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

◆ selectTrack:()

- (void) selectTrack: (int)  trackIndex

Switch definition according to the specified track index.

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

◆ setAuthSource:()

- (void) setAuthSource: (AVPVidAuthSource *)  source

Play by VID and playauth.

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

Parameters
sourceAVPVidAuthSource type.
See also
AVPVidAuthSource

◆ setCacheConfig:()

- (BOOL) setCacheConfig: (AVPCacheConfig *)  cacheConfig

Modify cache configuration.

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

◆ setConfig:()

- (void) setConfig: (AVPConfig *)  config

Modify player configuration.

Parameters
configAVPConfig type.
See also
AVPConfig

◆ setLogCallbackInfo:callbackBlock:()

+ (void) setLogCallbackInfo: (AVPLogLevel logLevel
callbackBlock: (void(^)(AVPLogLevel logLevel, NSString *strLog))  block 

Set a log output callback block.

Asynchronous.

Parameters
logLevelThe level of the log.
callbackBlockLog output callback block, which can be nil.

◆ setMpsSource:()

- (void) setMpsSource: (AVPVidMpsSource *)  source

◆ setPlayUrlConvertCallback:()

- (void) setPlayUrlConvertCallback: (PlayURLConverCallback callback

Set a URL conversion callback.

URL conversion is typically used in P2P broadcasting.

Parameters
callbackThe function pointer of the callback.

◆ setStsSource:()

- (void) setStsSource: (AVPVidStsSource *)  source

◆ setThumbnailUrl:()

- (void) setThumbnailUrl: (NSString *)  URL

Specify a thumbnail image URL.

Parameters
URLThe specified thumbnail image URL.

◆ setTraceID:()

- (void) setTraceID: (NSString *)  traceID

Set a trace ID for debugging.

Parameters
traceIDThe specified client connection trace ID.

◆ setUrlSource:()

- (void) setUrlSource: (AVPUrlSource *)  source

Play by URL.

Parameters
sourceAVPUrlSource type.
See also
AVPUrlSource

◆ snapShot()

- (void) snapShot

Snapshot.

AVPImage: For a Mac platform, NSImage is returned. For an iOS platform, UIImage is returned.

◆ start()

- (void) start

Start playing.

Implemented in AVPLiveTimeShift.

◆ stop()

- (void) stop

Stop.

Implemented in AVPLiveTimeShift.

Property Documentation

◆ autoPlay

- (BOOL) autoPlay
readwritenonatomicassign

Enable or disable autoplay.

KVO is supported.

◆ bufferedPosition

- (int64_t) bufferedPosition
readnonatomicassign

Query the buffered position.

KVO is supported.

◆ currentPosition

- (int64_t) currentPosition
readnonatomicassign

Query the current playback position.

KVO is supported.

◆ delegate

- (id<AVPDelegate>) delegate
readwritenonatomicweak

Set a proxy.

See AVPDelegate.

See also
AVPDelegate

◆ duration

- (int64_t) duration
readnonatomicassign

Query the length of the video.

KVO is supported.

◆ enableHardwareDecoder

- (BOOL) enableHardwareDecoder
readwritenonatomicassign

Enable or disable hardware decoding.

KVO is supported.

◆ enableLog

- (BOOL) enableLog
readwritenonatomicassign

Enable or disable logging.

See also
Use setLogCallbackInfo.

◆ height

- (int) height
readnonatomicassign

Query the height of the video.

KVO is supported.

◆ loop

- (BOOL) loop
readwritenonatomicassign

Enable or disable loop playback.

KVO is supported.

◆ mirrorMode

- (AVPMirrorMode) mirrorMode
readwritenonatomicassign

Set a mirroring mode.

KVO is supported.

See also
AVPMirrorMode

◆ muted

- (BOOL) muted
readwritenonatomicassign

Mute or unmute the player.

KVO is supported.

◆ playerView

- (AVPView*) playerView
readwritenonatomicstrong

Set a player view (playerView).

AVPView: Mac platform: NSOpenGLView. iOS platform: UIView.

◆ rate

- (float) rate
readwritenonatomicassign

Set the playback speed.

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

◆ rotateMode

- (AVPRotateMode) rotateMode
readwritenonatomicassign

Set a rotate mode.

KVO is supported.

See also
AVPRotateMode

◆ rotation

- (int) rotation
readnonatomicassign

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

KVO is supported.

◆ scalingMode

- (AVPScalingMode) scalingMode
readwritenonatomicassign

Set a zoom mode.

KVO is supported.

See also
AVPScalingMode

◆ volume

- (float) volume
readwritenonatomicassign

Query or set the volume of the player.

KVO is supported.

◆ width

- (int) width
readnonatomicassign

Query the width of the video.

KVO is supported.


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