ZegoMediaPlayerEventWithIndexDelegate Protocol Reference

Conforms to NSObject
Declared in zego-api-mediaplayer-oc.h

Overview

多实例播放器的回调接口

– onPlayStart:

开始播放

- (void)onPlayStart:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Declared In

zego-api-mediaplayer-oc.h

– onPlayPause:

暂停播放

- (void)onPlayPause:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Declared In

zego-api-mediaplayer-oc.h

– onPlayResume:

恢复播放

- (void)onPlayResume:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Declared In

zego-api-mediaplayer-oc.h

– onPlayError:playerIndex:

播放错误

- (void)onPlayError:(int)code playerIndex:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Discussion

@param code PLAY_ERROR_NOERROR = 0, PLAY_ERROR_FILE = -1,文件格式不支持, PLAY_ERROR_PATH = -2,路径不存在, PLAY_ERROR_CODEC = -3, 文件无法解码 PLAY_ERROR_NO_SUPPORT_STREAM = -4,文件中没有可播放的音视频流 PLAY_ERROR_DEMUX = -5, 文件解析过程中出现错误

Declared In

zego-api-mediaplayer-oc.h

– onVideoBegin:

开始播放视频

- (void)onVideoBegin:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Declared In

zego-api-mediaplayer-oc.h

– onAudioBegin:

开始播放音频

- (void)onAudioBegin:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Declared In

zego-api-mediaplayer-oc.h

– onPlayEnd:

播放结束

- (void)onPlayEnd:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Declared In

zego-api-mediaplayer-oc.h

– onPlayStop:

用户停止播放的回调

- (void)onPlayStop:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Declared In

zego-api-mediaplayer-oc.h

– onBufferBegin:

网络音乐资源播放不畅,开始尝试缓存数据。

- (void)onBufferBegin:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Discussion

Warning: 只有播放网络音乐资源才需要关注这个回调

Declared In

zego-api-mediaplayer-oc.h

– onBufferEnd:

网络音乐资源可以顺畅播放。

- (void)onBufferEnd:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Discussion

Warning: 只有播放网络音乐资源才需要关注这个回调

Declared In

zego-api-mediaplayer-oc.h

– onSeekComplete:when:playerIndex:

快进到指定时刻

- (void)onSeekComplete:(int)code when:(long)millisecond playerIndex:(ZegoMediaPlayerIndex)index

Parameters

code

=0 成功,其它表示失败

millisecond

实际快进的进度,单位毫秒

index

播放器序号

Declared In

zego-api-mediaplayer-oc.h

– onSnapshot:playerIndex:

截图

- (void)onSnapshot:(ZEGOImage *)image playerIndex:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Discussion

@param image

Declared In

zego-api-mediaplayer-oc.h

– onLoadComplete:

预加载完成

- (void)onLoadComplete:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Discussion

Warning: 调用 load 的回调

Declared In

zego-api-mediaplayer-oc.h

– onProcessInterval:playerIndex:

播放进度回调

- (void)onProcessInterval:(long)timestamp playerIndex:(ZegoMediaPlayerIndex)index

Parameters

timestamp

当前播放进度,单位毫秒

index

播放器序号

Discussion

Note: 同步回调,请不要在回调中处理数据或做其他耗时操作

Declared In

zego-api-mediaplayer-oc.h