ITXVodPlayCallback API 简介
点播播放器播放事件、网络事件回调监听接口。
回调接口概览
API | 描述 |
播放事件通知。 | |
播放过程中网络状态事件回调。 | |
截图回调。 | |
字幕数据回调。 |
回调接口详情
onPlayEvent
播放事件通知,包括开始播放、首帧事件、Loading 事件、播放进度、结束播放等事件。
onPlayEvent(player: TXVodPlayer, event: number, eventData?: Map<string, ParamType>): void
参数说明
参数名 | 类型 | 描述 |
player | TXVodPlayer | 当前播放器对象。 |
event | number | 播放器事件。 |
eventData | Map<string, ParamType> | 播放事件携带的参数,通过 (Key, Value) 保存,其中 Key 可以参考 TXVodConstants 中的事件参数。 |
onNetStatus
播放过程中网络状态事件回调。
onNetStatus(player: TXVodPlayer, statusData: Map<string, ParamType>): void
参数说明
参数名 | 类型 | 描述 |
player | TXVodPlayer | 当前播放器对象。 |
statusData | Map<string, ParamType> | 播放过程中网络状态参数,格式为:(Key, Value)。 |
onSnapshotComplete
截图回调(可选)。
onSnapshotComplete?(player: TXVodPlayer, pixelMap?: image.PixelMap): void
参数说明
参数名 | 类型 | 描述 |
player | TXVodPlayer | 当前播放器对象。 |
pixelMap | image.PixelMap | 截图图片数据。 |
onSubtitleData
字幕数据回调(可选)。
onSubtitleData?(player: TXVodPlayer, subtitleData: TXVodSubtitleData): void
参数说明
参数名 | 类型 | 描述 |
player | TXVodPlayer | 当前播放器对象。 |
subtitleData | TXVodSubtitleData |