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

code

错误码, 详见 ZegoMediaPlayerError

index

播放器序号

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:

播放进度回调,需要setProcessInterval设置interval大于0,才会抛出

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

Parameters

timestamp

当前播放进度,单位毫秒

index

播放器序号

Discussion

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

Declared In

zego-api-mediaplayer-oc.h

– onRenderingProcessInterval:playerIndex:

播放渲染进度回调,需要setProcessInterval设置interval大于0,才会抛出

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

Parameters

timestamp

当前播放渲染进度,单位毫秒

index

播放器序号

Discussion

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

Declared In

zego-api-mediaplayer-oc.h

– onReadEOF:

网络文件读完结尾的回调

- (void)onReadEOF:(ZegoMediaPlayerIndex)index

Parameters

index

播放器序号

Declared In

zego-api-mediaplayer-oc.h

– onVideoSizeChanged:playerIndex:

播放视频分辨率改变的回调

- (void)onVideoSizeChanged:(CGSize)size playerIndex:(ZegoMediaPlayerIndex)index

Parameters

size

分辨率

index

播放器序号

Declared In

zego-api-mediaplayer-oc.h