![]() |
AliyunPlayer v7.9.0
Aliyun Player API Reference Manual for iOS Platforms
|
#include "AliListPlayer.h"
Instance Methods | |
| (void) | - addUrlSource:uid: |
| Add a resource to the playlist. | |
| (void) | - addUrlSource:uid:config: |
| Add a resource to the playlist. | |
| (void) | - addVidSource:uid: |
| Add a resource to the playlist. | |
| (void) | - clear |
| Clear the playlist. | |
| (NSString *) | - currentUid |
| Query the UID of the resource that is being played. | |
| (void) | - destroy |
| Sync delete the player. | |
| (void) | - destroyAsync |
| Async delete the player. | |
| (void) | - enableStrategy:enable: |
| enable preload strategy. | |
| (AliPlayer *) | - getCurrentPlayer |
| (AVPMultiBitratesMode) | - GetMultiBiratesMode |
| Get current MultiBitrate preload mode. | |
| (AliPlayer *) | - getPreRenderPlayer |
| (instancetype) | - init |
| Initialize the playlist. | |
| (instancetype) | - init: |
| Initialize the player. | |
| (BOOL) | - moveTo: |
| Seek to the specified position and prepare for playback. | |
| (BOOL) | - moveTo:accId:accKey:token:region: |
| Seek to the specified resource and prepare for playback. | |
| (BOOL) | - moveTo:playAuth: |
| Seek to the specified resource and prepare for playback. | |
| (BOOL) | - moveToNext |
| Seek to the next resource and prepare for playback. | |
| (BOOL) | - moveToNext: |
| Seek to the next resource and prepare for playback. | |
| (BOOL) | - moveToNext:accKey:token:region: |
| Seek to the next resource and prepare for playback. | |
| (BOOL) | - moveToNextWithPrerendered |
| Seek to the next resource and prepare for playback. | |
| (BOOL) | - moveToNextWithPrerendered: |
| Seek to the next resource and prepare for playback. | |
| (BOOL) | - moveToNextWithPrerendered:accKey:token:region: |
| Seek to the next resource and prepare for playback. | |
| (BOOL) | - moveToPre |
| Seek to the previous resource and prepare for playback. | |
| (BOOL) | - moveToPre: |
| Seek to the previous resource and prepare for playback. | |
| (BOOL) | - moveToPre:accKey:token:region: |
| Seek to the previous resource and prepare for playback. | |
| (void) | - removeSource: |
| Remove a resource from the playlist. | |
| (void) | - SetMultiBitratesMode: |
| SetMultiBitrate preload mode. | |
| (void) | - setOption:valueInt: |
| Set specified option. | |
| (void) | - setPreloadCount:nextCount: |
| update set preload count | |
| (void) | - setScene: |
| Set preload scene. | |
| (void) | - setStrategyParam:strategyParam: |
| set strategy parameter. | |
| (void) | - stop |
| Stop. | |
| (void) | - updatePreloadConfig: |
| update preload config related to uid | |
| (void) | - updatePreloadConfiguid:config: |
| update preload config | |
Instance Methods inherited from AliPlayer | |
| (void) | - addExtSubtitle: |
| Add external subtitle file. | |
| (void) | - clearScreen |
| Clear screen. | |
| (void) | - clearScreenSync |
| Clear screen sync. | |
| (void) | - enableDowngrade:config: |
| Modify player configuration. | |
| (NSString *) | - getCacheFilePath: |
| Query the name of the cached file with the specified URL. | |
| (NSString *) | - getCacheFilePath:format:definition: |
| Query the name of the cached file with the specified URL. | |
| (NSString *) | - getCacheFilePath:format:definition:previewTime: |
| Query the name of the cached file with the specified URL. | |
| (AVPConfig *) | - getConfig |
| Query player configuration. | |
| (AVPTrackInfo *) | - getCurrentTrack: |
| Query the track that is being played. | |
| (AVPMediaInfo *) | - getMediaInfo |
| Query media information, including track information. | |
| (NSString *) | - getOption: |
| Get player information. | |
| (int64_t) | - getPlayedDuration |
| @breif get played time, will not affected by seek | |
| (void *) | - getPlayer |
| (NSString *) | - getPlayerName |
| Get used player name. | |
| (NSString *) | - getPropertyString: |
| Get information by key. | |
| (AVPMediaInfo *) | - getSubMediaInfo |
| Query media sub stream information, including track information. | |
| (void) | - getThumbnail: |
| Retrieve the thumbnail image at the specified position. | |
| (NSString *) | - getUserData |
| Get user data, and each player instance bind one. | |
| (int) | - invokeComponent: |
| Send command to component. | |
| (BOOL) | - isAutoBandWidth |
| Get the current status of adaptive selection of initial playback quality for multi-bitrate playback. | |
| (BOOL) | - isEnableSubtitleRender |
| (void) | - pause |
| Pause. | |
| (void) | - prepare |
| Prepare for playback. | |
| (void) | - redraw |
| Refresh the view in certain situations, for example, when the size of the view changes. | |
| (void) | - reload |
| Reload resources. | |
| (void) | - reset |
| Reset. | |
| (void) | - seekToTime:seekMode: |
| Seek to a specified position. | |
| (void) | - selectExtSubtitle:enable: |
| Select or disable the specified external subtitle track. | |
| (void) | - selectTrack: |
| Switch video quality according to the specified track index. | |
| (void) | - selectTrack:accurate: |
| Switch video quality according to the specified track index with accurate seeking option. | |
| (void) | - sendCustomEvent: |
Sends a user-defined event, which will be called back via OnReportEventListener. | |
| (void) | - setAuthSource: |
| Play by VID and playauth. | |
| (void) | - setAutoBandWidth: |
| Enable or disable adaptive selection of initial playback quality for multi-bitrate playback. | |
| (void) | - setBitStreamSource: |
| Play by bit stream. | |
| (BOOL) | - setCacheConfig: |
| Modify cache configuration. | |
| (void) | - setConfig: |
| Modify player configuration. | |
| (void) | - setDefaultBandWidth: |
| Set the default initial playback bitrate for multi-bitrate playback. | |
| (void) | - setDefaultResolution: |
| Set the default initial playback resolution for multi-bitrate playback. | |
| (void) | - setEnableSubtitleRender: |
| is open subtitle render | |
| (void) | - setEventReportParamsDelegate: |
| Set a proxy. | |
| (void) | - setFilterConfig: |
| Set filter config. | |
| (void) | - setFilterInvalid:invalid: |
| disable/enable filter. | |
| (void) | - setLiveStsSource: |
| Play by 使用LiveSts. | |
| (void) | - setMaxAccurateSeekDelta: |
| set the maximum interval of precision seek. | |
| (void) | - setMpsSource: |
| Play by VID and MPS. | |
| (void) | - setOption:value: |
| Set specified option. | |
| (void) | - setPictureinPictureDelegate: |
| set delegate for picture in picture | |
| (void) | - setPictureInPictureEnable: |
| Set picture in picture enable (The picture in picture function of the player requires systems above ios15. | |
| (void) | - setPictureInPictureShowMode: |
| set show mode for picture in picture | |
| (void) | - setPlayerScene: |
| Set player scene. | |
| (void) | - setPlayUrlConvertCallback: |
| Set a URL conversion callback. | |
| (void) | - setPreferPlayerName: |
Sets the preferred player kernel when playing, the default is the self-developed player core, can be switched to the system player, set before calling prepare. | |
| (void) | - setStartTime:seekMode: |
| Set a specified position as play start.Call this API before prepare, only take effect once. | |
| (void) | - setStreamDelayTime:time: |
| set the delay time of the stream | |
| (void) | - setStsSource: |
| Play by VID and STS. | |
| (void) | - setThumbnailUrl: |
| Specify a thumbnail image URL. | |
| (void) | - setTraceID: |
| Set a trace ID for debugging. | |
| (void) | - setUrlSource: |
| Play by URL. | |
| (void) | - setUserData: |
| Set user data for the player instance, which can be used to distinguish different player instances in multi-instance scenarios. | |
| (void) | - setVerifyStsCallback: |
| During encrypted live streaming, there might be processes to change the encryption key. | |
| (void) | - setVideoTag:size: |
| Set the video tags. | |
| (void) | - snapShot |
| Create a snapshot for the current frame. | |
| (void) | - start |
| Start playing. | |
| (void) | - switchStream: |
| Multi definition stream switch by url. | |
| (void) | - updateFilterConfig:options: |
| upadate filter config. | |
| (void) | - updateLiveStsInfo:accKey:token:region: |
| update LiveStsInfo. | |
Properties | |
| int | maxPreloadMemorySizeMB |
| Set the maximum preloading cache size. | |
| NSString * | playAuthPreloadDefinition |
| int | preloadCount |
| Query or set the number of preloaded resources. | |
| NSString * | stsPreloadDefinition |
| Query or set the definition for playback by STS, such as LD or HD. | |
Properties inherited from AliPlayer | |
| id< CicadaRenderDelegate > renderDelegate | __deprecated |
| Set the render callback. | |
| AVPAlphaRenderMode | alphaRenderMode |
| Set alpha render mode, can be used on gift play on live stream, etc. | |
| BOOL | autoPlay |
| Enable or disable autoplay. | |
| int64_t | bufferedPosition |
| Query the buffered position. | |
| int64_t | currentDownloadSpeed |
| Query the current download speed. | |
| int64_t | currentPosition |
| Query the current playback position. | |
| int64_t | currentUtcTime |
| Query the current playback utc time. | |
| id< AVPDelegate > | delegate |
| Set a proxy. | |
| id< AVPDrmDelegate > | drmDelegate |
| set DRM request callback. | |
| int64_t | duration |
| Query the length of the video. | |
| BOOL | enableHardwareDecoder |
| Enable or disable hardware decoding. | |
| id< AVPEventReportParamsDelegate > | eventReportParamsDelegate |
| Set the event report callback. | |
| int | height |
| Query the height of the video. | |
| int64_t | localCacheLoadedSize |
| Query the current playback cached file size. | |
| BOOL | loop |
| Enable or disable loop playback. | |
| AVPMirrorMode | mirrorMode |
| Set a mirroring mode. | |
| BOOL | muted |
| Mute or unmute the player. | |
| AVPOutputAudioChannel | outputAudioChannel |
| Set the output audio channel, if input source is stereo, support select to left or right channel and if intput source is mono, this api can't take effect. | |
| AVPStatus | playerStatus |
| Query the player status. | |
| AVPView * | playerView |
| Set a player view (playerView). | |
| float | rate |
| Set the playback speed. | |
| id< CicadaRenderingDelegate > | renderingDelegate |
| Set the render callback. | |
| AVPRotateMode | rotateMode |
| Set a rotate mode. | |
| int | rotation |
| Query the rotate angle of the video, which is retrieved from the video metadata. | |
| AVPScalingMode | scalingMode |
| Set a zoom mode. | |
| float | volume |
| Query or set the volume of the player(Not system volume). | |
| int | width |
| Query the width of the video. | |
Additional Inherited Members | |
Class Methods inherited from AliPlayer | |
| (NSString *) | + getDeviceUUID |
| Query device UUID. | |
| (NSString *) | + getSDKVersion |
| Query the SDK version. | |
| (void) | + initPlayerComponent:function: |
| Initialize player components. | |
| (BOOL) | + isFeatureSupport: |
| judge whether support the type of feature. | |
| (void) | + netWorkReConnect |
| reconnect all connections, call this when netWork router changed, and the player will use new router. | |
| (void) | + setAudioSessionDelegate: |
| Set AudioSession Delegate. | |
| (void) | + setEnableLog: |
| Enable or disable logging. | |
| (void) | + setLogCallbackInfo:callbackBlock: |
| Set a log output callback block. | |
| (void) | + setLogOption:value: |
| Set log option. | |
| - (void) addUrlSource: | (NSString *) | url | |
| uid: | (NSString *) | uid |
Add a resource to the playlist.
| url | Specify a resource by URL. |
| uid | The UID of the resource, which uniquely identifies a resource. |
| - (void) addUrlSource: | (NSString *) | urlSource | |
| uid: | (NSString *) | uid | |
| config: | (AVPPreloadConfig *) | config |
Add a resource to the playlist.
| url | Specify a resource by URL. |
| uid | The UID of the resource, which uniquely identifies a resource. |
| config | preload config |
| - (void) addVidSource: | (NSString *) | vid | |
| uid: | (NSString *) | uid |
Add a resource to the playlist.
| vid | Specify a resource by VID. |
| uid | The UID of the resource, which uniquely identifies a resource. |
| - (void) clear |
Clear the playlist.
| - (NSString *) currentUid |
Query the UID of the resource that is being played.
| - (void) destroy |
Sync delete the player.
Implements AliPlayer.
| - (void) destroyAsync |
Async delete the player.
When instance is not needed, skip calling stop api and call this destroyAsync api can speed up view response. Once called, don't call prepare to start new play.
Implements AliPlayer.
| - (void) enableStrategy: | (AVPStrategyType) | type | |
| enable: | (bool) | enable |
enable preload strategy.
| type | strategy type, see AVPStrategyType |
| enable | enable strategy |
| - (AliPlayer *) getCurrentPlayer |
| - (AVPMultiBitratesMode) GetMultiBiratesMode |
Get current MultiBitrate preload mode.
| - (AliPlayer *) getPreRenderPlayer |
| - (instancetype) init |
Initialize the playlist.
Implements AliPlayer.
| - (instancetype) init: | (NSString *) | traceID |
| - (BOOL) moveTo: | (NSString *) | uid |
Seek to the specified position and prepare for playback.
Only playback by URL is supported.
| uid | The UID of the specified resource, which uniquely identifies a resource. |
| - (BOOL) moveTo: | (NSString *) | uid | |
| accId: | (NSString *) | accId | |
| accKey: | (NSString *) | accKey | |
| token: | (NSString *) | token | |
| region: | (NSString *) | region |
Seek to the specified resource and prepare for playback.
Only playback by STS is supported. You must update the STS information.
| uid | The UID of the specified resource, which uniquely identifies a resource. |
| accId | vid The AccessKey ID. |
| accKey | vid The AccessKey Secret. |
| token | vid The STS token. |
| region | vid The specified region. Default: cn-shanghai. |
| - (BOOL) moveTo: | (NSString *) | uid | |
| playAuth: | (NSString *) | playAuth |
Seek to the specified resource and prepare for playback.
Only playback by playauth is supported. You must update the playauth information.
| uid | The UID of the specified resource, which uniquely identifies a resource. |
| playAuth | vid The playAuth ID. |
| - (BOOL) moveToNext |
Seek to the next resource and prepare for playback.
Only playback by URL is supported.
| - (BOOL) moveToNext: | (NSString *) | playAuth |
Seek to the next resource and prepare for playback.
Only playback by playauth is supported. You must update the playauth information.
| playAuth | vid The playAuth ID. |
| - (BOOL) moveToNext: | (NSString *) | accId | |
| accKey: | (NSString *) | accKey | |
| token: | (NSString *) | token | |
| region: | (NSString *) | region |
Seek to the next resource and prepare for playback.
Only playback by STS is supported. You must update the STS information.
| accId | vid The AccessKey ID. |
| accKey | vid The AccessKey Secret. |
| token | vid The STS token. |
| region | vid The specified region. Default: cn-shanghai. |
| - (BOOL) moveToNextWithPrerendered |
Seek to the next resource and prepare for playback.
Only playback by URL is supported.
| - (BOOL) moveToNextWithPrerendered: | (NSString *) | playAuth |
Seek to the next resource and prepare for playback.
Only playback by playauth is supported. You must update the playauth information.
| playAuth | vid The playAuth ID. |
| - (BOOL) moveToNextWithPrerendered: | (NSString *) | accId | |
| accKey: | (NSString *) | accKey | |
| token: | (NSString *) | token | |
| region: | (NSString *) | region |
Seek to the next resource and prepare for playback.
Only playback by STS is supported. You must update the STS information.
| accId | vid The AccessKey ID. |
| accKey | vid The AccessKey Secret. |
| token | vid The STS token. |
| region | vid The specified region. Default: cn-shanghai. |
| - (BOOL) moveToPre |
Seek to the previous resource and prepare for playback.
Only playback by URL is supported.
| - (BOOL) moveToPre: | (NSString *) | playAuth |
Seek to the previous resource and prepare for playback.
Only playback by playauth is supported. You must update the playauth information.
| playAuth | vid The playAuth ID. |
| - (BOOL) moveToPre: | (NSString *) | accId | |
| accKey: | (NSString *) | accKey | |
| token: | (NSString *) | token | |
| region: | (NSString *) | region |
Seek to the previous resource and prepare for playback.
Only playback by STS is supported. You must update the STS information.
| accId | vid The AccessKey ID. |
| accKey | vid The AccessKey Secret. |
| token | vid The STS token. |
| region | vid The specified region. Default: cn-shanghai. |
| - (void) removeSource: | (NSString *) | uid |
Remove a resource from the playlist.
| uid | The UID of the resource, which uniquely identifies a resource. |
| - (void) SetMultiBitratesMode: | (AVPMultiBitratesMode) | mode |
SetMultiBitrate preload mode.
| mode | The MultiBitrate preload mode |
| - (void) setOption: | (PlayerOption) | key | |
| valueInt: | (int) | value |
Set specified option.
Implements AliPlayer.
| - (void) setPreloadCount: | (int) | prevCount | |
| nextCount: | (int) | nextCount |
update set preload count
| prevCount | previous preload count |
| nextCount | next preload count |
| - (void) setScene: | (AVPSceneType) | type |
Set preload scene.
| type | scene type, see AVPSceneType |
| - (void) setStrategyParam: | (AVPStrategyType) | type | |
| strategyParam: | (NSString *) | strategyParam |
set strategy parameter.
| type | strategy type, see AVPStrategyType |
| strategyParam | strategy parameter, type is json string support param: algorithm, offset, scale for example: dynamic preload duration decrease strategy default strategy { "algorithm":"sub", "offset":"500" } transfer to string: "{\"algorithm\": \"div\",\"scale\": \"0.75\"}" or { "algorithm":"div", "scale":"0.75" } |
| - (void) stop |
Stop.
Implements AliPlayer.
| - (void) updatePreloadConfig: | (AVPPreloadConfig *) | config |
update preload config related to uid
| uid | each URL is a unique UID |
| config | preload config, see AVPPreloadConfig |
| - (void) updatePreloadConfiguid: | (NSString *) | uid | |
| config: | (AVPPreloadConfig *) | config |
update preload config
| config | preload config, see AVPPreloadConfig |
|
readwritenonatomicassign |
Set the maximum preloading cache size.
Default: 100 MB. Minimum: 20 MB.
|
readwritenonatomiccopy |
|
readwritenonatomicassign |
Query or set the number of preloaded resources.
The number of resources before preloading and the number of resources after preloading are returned. Default: 2.
|
readwritenonatomiccopy |
Query or set the definition for playback by STS, such as LD or HD.
Call this method before moveTo. After the resources are preloaded, you cannot change the definition.