#include "AVPDelegate.h"
◆ onBufferedPositionUpdate:position:
| - (void) onBufferedPositionUpdate: |
|
(AliPlayer *) | player |
| position: |
|
(int64_t) | position |
|
optionalrequired |
视频缓冲位置回调
- Parameters
-
| player | 播放器player指针 |
| position | 视频当前缓冲位置,单位毫秒 表示当前已缓冲到的位置,可用于显示缓冲进度条,触发频率可通过AVPConfig::positionTimerIntervalMs调整 |
- See also
- AliPlayer::bufferedPosition
◆ onCaptureScreen:image:
| - (void) onCaptureScreen: |
|
(AliPlayer *) | player |
| image: |
|
(AVPImage *) | image |
|
optionalrequired |
◆ onChooseTrackIndex:info:
选择希望播放的流
- Parameters
-
| player | 播放器player指针 |
| info | track流信息数组 |
- Returns
- 返回要播放的流索引
- See also
- AVPTrackInfo
-
AliPlayer::selectTrack
◆ onCurrentDownloadSpeed:speed:
| - (void) onCurrentDownloadSpeed: |
|
(AliPlayer *) | player |
| speed: |
|
(int64_t) | speed |
|
optionalrequired |
◆ onCurrentPositionUpdate:position:
| - (void) onCurrentPositionUpdate: |
|
(AliPlayer *) | player |
| position: |
|
(int64_t) | position |
|
optionalrequired |
视频当前播放位置回调
- Parameters
-
| player | 播放器player指针 |
| position | 视频当前播放位置,单位毫秒 触发频率:通过AVPConfig::positionTimerIntervalMs调整 |
- See also
- AliPlayer::currentPosition
◆ onCurrentUtcTimeUpdate:time:
| - (void) onCurrentUtcTimeUpdate: |
|
(AliPlayer *) | player |
| time: |
|
(int64_t) | time |
|
optionalrequired |
◆ onError:errorModel:
错误代理回调
- Parameters
-
| player | 播放器player指针 |
| errorModel | 播放器错误描述,参考AVPErrorModel 触发时机:播放过程中发生错误时回调,包括网络错误、解码错误、文件错误等 |
- See also
- AVPErrorModel
◆ onGetThumbnailFailed:
| - (void) onGetThumbnailFailed: |
|
(int64_t) | positionMs |
|
|
optionalrequired |
获取缩略图失败回调
- Parameters
-
- See also
- AliPlayer::getThumbnail
◆ onGetThumbnailSuc:fromPos:toPos:image:
| - (void) onGetThumbnailSuc: |
|
(int64_t) | positionMs |
| fromPos: |
|
(int64_t) | fromPos |
| toPos: |
|
(int64_t) | toPos |
| image: |
|
(id) | image |
|
optionalrequired |
获取缩略图成功回调
- Parameters
-
| positionMs | 指定的缩略图位置 |
| fromPos | 此缩略图的开始位置 |
| toPos | 此缩略图的结束位置 |
| image | 缩图略图像指针,对于mac是NSImage,iOS平台是UIImage指针 触发时机:调用AliPlayer::getThumbnail成功后回调 |
- See also
- AliPlayer::getThumbnail
◆ onLoadingProgress:progress:
| - (void) onLoadingProgress: |
|
(AliPlayer *) | player |
| progress: |
|
(float) | progress |
|
optionalrequired |
视频缓冲进度回调,用于显示Loading进度
- Parameters
-
| player | 播放器player指针 |
| progress | 缓存进度0-100,表示缓冲完成的百分比 |
◆ onLocalCacheLoaded:size:
| - (void) onLocalCacheLoaded: |
|
(AliPlayer *) | player |
| size: |
|
(int64_t) | size |
|
optionalrequired |
◆ onNetworkStat:stat:
获取网络质量信息回调, 当前该监听器仅对超低延时直播(RTS)拉流场景生效。
- Parameters
-
| player | 播放器player指针 |
| stat | 网络质量信息,包含丢包率、延迟等指标 |
- See also
- AVPNetworkStat
◆ onPlayerEvent:eventType:
播放器事件回调
- Parameters
-
| player | 播放器player指针 |
| eventType | 播放器事件类型 |
- See also
- AVPEventType
◆ onPlayerEvent:eventWithString:description:
| - (void) onPlayerEvent: |
|
(AliPlayer *) | player |
| eventWithString: |
|
(AVPEventWithString) | eventWithString |
| description: |
|
(NSString *) | description |
|
optionalrequired |
播放器事件回调(带字符串描述)
- Parameters
-
| player | 播放器player指针 |
| eventWithString | 播放器事件类型字符串 |
| description | 播放器事件详细说明 |
- See also
- AVPEventType
◆ onPlayerStatusChanged:oldStatus:newStatus:
播放器状态改变回调
- Parameters
-
| player | 播放器player指针 |
| oldStatus | 老的播放器状态 参考AVPStatus |
| newStatus | 新的播放器状态 参考AVPStatus 触发时机:播放器状态发生变化时回调,包括idle、prepared、started、paused、stopped、completed、error等状态 |
- See also
- AVPStatus
-
AliPlayer::playerStatus
◆ onSEIData:type:uuid:data:
| - (void) onSEIData: |
|
(AliPlayer *) | player |
| type: |
|
(int) | type |
| uuid: |
|
(NSData *) | uuid |
| data: |
|
(NSData *) | data |
|
optionalrequired |
SEI回调
- Parameters
-
| player | 播放器player指针 |
| type | 类型 |
| uuid | 数据(当type=5时,uuid值有效,播放器sdk 6.11.0及之后的版本新增) |
| data | 数据(不包含uuid部分,跟6.10.0及之前的版本语义保持一致) 触发时机:解码器解析到SEI数据时回调 |
◆ onStreamSwitchedFail:URL:errorModel:
| - (void) onStreamSwitchedFail: |
|
(AliPlayer *) | player |
| URL: |
|
(NSString *) | URL |
| errorModel: |
|
(AVPErrorModel *) | errorModel |
|
optionalrequired |
根据url切换清晰度流失败通知
- Parameters
-
- See also
- AliPlayer::switchStream
◆ onStreamSwitchedSuccess:URL:
| - (void) onStreamSwitchedSuccess: |
|
(AliPlayer *) | player |
| URL: |
|
(NSString *) | URL |
|
optionalrequired |
根据url切换清晰度流成功通知
- Parameters
-
- See also
- AliPlayer::switchStream
◆ onSubtitleExtAdded:trackIndex:URL:
| - (void) onSubtitleExtAdded: |
|
(AliPlayer *) | player |
| trackIndex: |
|
(int) | trackIndex |
| URL: |
|
(NSString *) | URL |
|
optionalrequired |
外挂字幕被添加
- Parameters
-
- See also
- AliPlayer::addExtSubtitle
◆ onSubtitleHeader:trackIndex:Header:
| - (void) onSubtitleHeader: |
|
(AliPlayer *) | player |
| trackIndex: |
|
(int) | trackIndex |
| Header: |
|
(NSString *) | header |
|
optionalrequired |
字幕头信息回调。用于ASS或VTT字幕等需要头信息的格式。如果实现此回调,播放器将不会自动渲染字幕,需要调用者自行完成字幕渲染。
- Parameters
-
| player | 播放器实例指针 |
| trackIndex | 字幕轨道索引 |
| header | 字幕头信息内容 外挂字幕用法参考外挂字幕 |
◆ onSubtitleHide:trackIndex:subtitleID:
| - (void) onSubtitleHide: |
|
(AliPlayer *) | player |
| trackIndex: |
|
(int) | trackIndex |
| subtitleID: |
|
(long) | subtitleID |
|
optionalrequired |
字幕隐藏回调
- Parameters
-
| player | 播放器player指针 |
| trackIndex | 字幕流索引. |
| subtitleID | 字幕ID. 触发时机:字幕需要隐藏时回调 |
- See also
- AliPlayer::selectExtSubtitle
◆ onSubtitleShow:trackIndex:subtitleID:subtitle:
| - (void) onSubtitleShow: |
|
(AliPlayer *) | player |
| trackIndex: |
|
(int) | trackIndex |
| subtitleID: |
|
(long) | subtitleID |
| subtitle: |
|
(NSString *) | subtitle |
|
optionalrequired |
字幕显示回调
- Parameters
-
| player | 播放器player指针 |
| trackIndex | 字幕流索引. |
| subtitleID | 字幕ID. |
| subtitle | 字幕显示的字符串 触发时机:字幕需要显示时回调 |
- See also
- AliPlayer::selectExtSubtitle
◆ onSubTrackReady:info:
◆ onTrackChanged:info:
track切换完成回调
- Parameters
-
- See also
- AVPTrackInfo
-
AliPlayer::selectTrack
◆ onTrackReady:info:
◆ onUrlExpired:expiredUrl:callback:
URL过期回调
- Parameters
-
| player | 播放器player指针 |
| expiredUrl | 过期的URL |
| callback | URL刷新回调 触发时机:播放器检测到URL过期时回调,可用于实现URL自动刷新功能 |
◆ onURLSourceExpired:expiredSource:callback:
URL源过期回调
- Parameters
-
| player | 播放器player指针 |
| expiredSource | 过期的URL源对象 |
| callback | 源刷新回调 |
◆ onVidAuthExpired:expiredSource:callback:
VidAuth源过期回调
- Parameters
-
| player | 播放器player指针 |
| expiredSource | 过期的VidAuth源对象 |
| callback | 源刷新回调 |
◆ onVideoRendered:timeMs:pts:
| - (void) onVideoRendered: |
|
(AliPlayer *) | player |
| timeMs: |
|
(int64_t) | timeMs |
| pts: |
|
(int64_t) | pts |
|
optionalrequired |
播放器渲染信息回调
- Parameters
-
| player | 播放器player指针 |
| timeMs | 渲染时的系统时间,单位毫秒 |
| pts | 视频帧pts 触发时机:每帧视频渲染完成时回调,可用于帧级监控和性能分析 |
- See also
- AliPlayer::setOnVideoRenderedListener
◆ onVideoSizeChanged:width:height:rotation:
| - (void) onVideoSizeChanged: |
|
(AliPlayer *) | player |
| width: |
|
(int) | width |
| height: |
|
(int) | height |
| rotation: |
|
(int) | rotation |
|
optionalrequired |
视频大小变化回调
- Parameters
-
| player | 播放器player指针 |
| width | 视频宽度 |
| height | 视频高度 |
| rotation | 视频旋转角度 触发时机:视频元数据加载完成或视频分辨率发生变化时回调 |
The documentation for this protocol was generated from the following file: