AliyunPlayer  v5.4.5.0
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) - addExtSubtitle:
 Add external subtitles. More...
 
(void) - clearScreen
 Clear screen. More...
 
(void) - DEPRECATED_ATTRIBUTE
 Reset. More...
 
("will not take effect") - DEPRECATED_MSG_ATTRIBUTE
 Refresh the view in certain situations, for example, when the size of the view changes. More...
 
(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 *) - getOption:
 Get player information. More...
 
(void *) - getPlayer
 
(NSString *) - getPlayerName
 Get used player name. 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...
 
(int) - invokeComponent:
 Send command to component. More...
 
(void) - pause
 Pause. More...
 
(void) - prepare
 Prepare for playback. More...
 
(void) - reload
 Reload resources. More...
 
(void) - seekToTime:seekMode:
 Seek to a specified position. More...
 
(void) - selectExtSubtitle:enable:
 Select external subtitles. More...
 
(void) - selectTrack:
 Switch definition according to the specified track index. More...
 
(void) - selectTrack:accurate:
 Switch definition according to the specified track index. More...
 
(void) - sendCustomEvent:
 Send custom event, will callback through AVPEventReportParamsDelegate. More...
 
(void) - setAuthSource:
 Play by VID and playauth. More...
 
(void) - setBitStreamSource:
 Play by bit stream. More...
 
(BOOL) - setCacheConfig:
 Modify cache configuration. More...
 
(void) - setConfig:
 Modify player configuration. More...
 
(void) - setDefaultBandWidth:
 Set the default playback bitrate for multi-bit rate. More...
 
(void) - setEventReportParamsDelegate:
 Set a proxy. More...
 
(void) - setFilterConfig:
 Set filter config. More...
 
(void) - setFilterInvalid:invalid:
 disable/enable filter. More...
 
(void) - setLiveStsSource:
 Play by 使用LiveSts. More...
 
(void) - setMaxAccurateSeekDelta:
 set the maximum interval of precision seek. More...
 
(void) - setMpsSource:
 Play by VID and MPS. More...
 
(void) - setPlayUrlConvertCallback:
 Set a URL conversion callback. More...
 
(void) - setPreferPlayerName:
 Set preper player name. More...
 
(void) - setStreamDelayTime:time:
 set the delay time of the stream 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) - setVerifyStsCallback:
 Set the AVPStsInfo expiration callback. More...
 
(void) - setVideoTag:size:
 Set the video tags. More...
 
(void) - snapShot
 Snapshot. More...
 
(void) - start
 Start playing. More...
 
(void) - stop
 Stop. More...
 
(void) - updateFilterConfig:options:
 upadate filter config. More...
 
(void) - updateLiveStsInfo:accKey:token:region:
 update liveSts info. More...
 

Class Methods

(NSString *) + getDeviceUUID
 Query device UUID. More...
 
(NSString *) + getSDKVersion
 Query the SDK version. More...
 
(void) + initPlayerComponent:function:
 Initialize player components. More...
 
(void) + netWorkReConnect
 reconnect all connections, call this when netWork router changed, and the player will use new router. More...
 
(void) + setAudioSessionDelegate:
 Set AudioSession Delegate. More...
 
(void) + setEnableLog:
 Enable or disable logging. More...
 
(void) + setLogCallbackInfo:callbackBlock:
 Set a log output callback block. More...
 

Properties

id< CicadaRenderDelegate > renderDelegate __deprecated
 Set the render callback. More...
 
BOOL autoPlay
 Enable or disable autoplay. More...
 
int64_t bufferedPosition
 Query the buffered position. More...
 
int64_t currentDownloadSpeed
 Query the current download speed. More...
 
int64_t currentPosition
 Query the current playback position. More...
 
int64_t currentUtcTime
 Query the current playback utc time. 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...
 
id< AVPEventReportParamsDelegateeventReportParamsDelegate
 Set the event report callback. More...
 
int height
 Query the height of the video. More...
 
int64_t localCacheLoadedSize
 Query the current playback cached file size. 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...
 
id< CicadaRenderingDelegate > renderingDelegate
 Set the render callback. 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(Not system volume). More...
 
int width
 Query the width of the video. More...
 

Method Documentation

◆ addExtSubtitle:

- (void) addExtSubtitle: (NSString *)  URL

Add external subtitles.

Parameters
URLsubtitle address

◆ clearScreen

- (void) clearScreen

Clear screen.

◆ DEPRECATED_ATTRIBUTE

- (void) DEPRECATED_ATTRIBUTE

Reset.

◆ DEPRECATED_MSG_ATTRIBUTE

- ("will not take effect") DEPRECATED_MSG_ATTRIBUTE

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

◆ destroy

- (void) destroy

Delete the player.

Implemented in AliListPlayer.

◆ 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

◆ getDeviceUUID

+ (NSString *) getDeviceUUID

Query device UUID.

◆ getMediaInfo

- (AVPMediaInfo*) getMediaInfo

Query media information, including track information.

◆ getOption:

- (NSString *) getOption: (AVPOption key

Get player information.

Parameters
keyThe key
Returns
The information

◆ getPlayer

- (void *) getPlayer

◆ getPlayerName

- (NSString *) getPlayerName

Get used player name.

◆ 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. Set as "DisableAnalytics" to disable report analytics data to server(not recommended).

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.

◆ invokeComponent:

- (int) invokeComponent: (NSString *)  content

Send command to component.

Parameters
contentcommand content
Returns
< 0 on Error

◆ netWorkReConnect

+ (void) netWorkReConnect

reconnect all connections, call this when netWork router changed, and the player will use new router.

◆ pause

- (void) pause

Pause.

◆ prepare

- (void) prepare

Prepare for playback.

Asynchronous callback.

◆ reload

- (void) reload

Reload resources.

You can reload resources when the network connection times out.

◆ 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, Unit: millisecond.
seekModeSeek mode.
See also
AVPSeekMode

◆ selectExtSubtitle:enable:

- (void) selectExtSubtitle: (int)  trackIndex
enable: (BOOL)  enable 

Select external subtitles.

Parameters
trackIndexcaption index
enabletrue: select, false: close

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

◆ selectTrack:accurate:

- (void) selectTrack: (int)  trackIndex
accurate: (BOOL)  accurate 

Switch definition according to the specified track index.

Parameters
trackIndexSpecify a definition index. SELECT_AVPTRACK_TYPE_VIDEO_AUTO: auto bitrate adjustment.
accurateUse accurate seeking to select track。

◆ sendCustomEvent:

- (void) sendCustomEvent: (NSString *)  args

Send custom event, will callback through AVPEventReportParamsDelegate.

Event id e = 5001.

◆ setAudioSessionDelegate:

+ (void) setAudioSessionDelegate: (id< CicadaAudioSessionDelegate >)  delegate

Set AudioSession Delegate.

Parameters
delegatethe Delegate

◆ 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

◆ setBitStreamSource:

- (void) setBitStreamSource: (AVPBitStreamSource *)  source

Play by bit stream.

Parameters
sourceAVPBitStreamSource type.
See also
AVPBitStreamSource

◆ 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

◆ setDefaultBandWidth:

- (void) setDefaultBandWidth: (int)  bandWidth

Set the default playback bitrate for multi-bit rate.

The nearest stream will be selected.

Parameters
bandWidthbit rate .

◆ setEnableLog:

+ (void) setEnableLog: (BOOL)  enableLog

Enable or disable logging.

Parameters
enableLogset as true to output log
See also
Use setLogCallbackInfo.

◆ setEventReportParamsDelegate:

- (void) setEventReportParamsDelegate: (id< AVPEventReportParamsDelegate >)  delegate

◆ setFilterConfig:

- (void) setFilterConfig: (AVPFilterConfig *)  filterConfig

Set filter config.

call this before prepare. If want update filter config, call updateFilterConfig()

Parameters
filterConfig

◆ setFilterInvalid:invalid:

- (void) setFilterInvalid: (NSString *)  target
invalid: (BOOL)  invalid 

disable/enable filter.

Parameters
targetif empty , disable all filters.
invalidtrue: enable(default); false: disable

◆ setLiveStsSource:

- (void) setLiveStsSource: (AVPLiveStsSource *)  source

Play by 使用LiveSts.

Parameters
sourceAVPLiveStsSource type.

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

◆ setMaxAccurateSeekDelta:

- (void) setMaxAccurateSeekDelta: (int)  delta

set the maximum interval of precision seek.

Parameters
deltainterval in milliseconds

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

◆ setPreferPlayerName:

- (void) setPreferPlayerName: (NSString *)  name

Set preper player name.

Parameters
namepreper player name.

◆ setStreamDelayTime:time:

- (void) setStreamDelayTime: (int)  index
time: (int)  time 

set the delay time of the stream

Parameters
indexsteam index
timems

◆ 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

◆ setVerifyStsCallback:

- (void) setVerifyStsCallback: (AVPStsStatus(^)(AVPStsInfo info))  callback

Set the AVPStsInfo expiration callback.

Parameters
callback

◆ setVideoTag:size:

- (void) setVideoTag: (int *)  tags
size: (int)  size 

Set the video tags.

Values range from [0,99].

◆ 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, and AliListPlayer.

◆ updateFilterConfig:options:

- (void) updateFilterConfig: (NSString *)  target
options: (AVPFilterOptions *)  options 

upadate filter config.

Parameters
target
options

◆ updateLiveStsInfo:accKey:token:region:

- (void) updateLiveStsInfo: (NSString *)  accId
accKey: (NSString *)  accKey
token: (NSString *)  token
region: (NSString *)  region 

update liveSts info.

Property Documentation

◆ __deprecated

- (id<CicadaRenderDelegate> renderDelegate) __deprecated
readwritenonatomicweak

Set the render callback.

Deprecated, use the renderingDelegate.

◆ autoPlay

- (BOOL) autoPlay
readwritenonatomicassign

Enable or disable autoplay.

KVO is supported.

◆ bufferedPosition

- (int64_t) bufferedPosition
readnonatomicassign

Query the buffered position.

KVO is supported.

◆ currentDownloadSpeed

- (int64_t) currentDownloadSpeed
readnonatomicassign

Query the current download speed.

KVO is supported.

◆ currentPosition

- (int64_t) currentPosition
readnonatomicassign

Query the current playback position.

KVO is supported.

◆ currentUtcTime

- (int64_t) currentUtcTime
readnonatomicassign

Query the current playback utc time.

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.

◆ eventReportParamsDelegate

- (id<AVPEventReportParamsDelegate>) eventReportParamsDelegate
readwritenonatomicweak

Set the event report callback.

◆ height

- (int) height
readnonatomicassign

Query the height of the video.

KVO is supported.

◆ localCacheLoadedSize

- (int64_t) localCacheLoadedSize
readnonatomicassign

Query the current playback cached file size.

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.

◆ renderingDelegate

- (id<CicadaRenderingDelegate>) renderingDelegate
readwritenonatomicweak

Set the render callback.

◆ 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(Not system volume).

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

◆ width

- (int) width
readnonatomicassign

Query the width of the video.

KVO is supported.


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