ZegoEventHandler

Declared in ZegoExpressEventHandler.h

Includes

Public-Func Lists

Public-Func Docs

onDebugError:funcName:info:

- (void)onDebugError:(int) errorCode funcName:(NSString *) funcName info:(NSString *) info;

Debug error message callback.

Parameters
errorCode Error code, please refer to the common error code document [] for details
funcName Function name
info Detailed error information

onRoomStateUpdate:errorCode:extendedData:roomID:

- (void)onRoomStateUpdate:(ZegoRoomState) state errorCode:(int) errorCode extendedData:(nullable NSDictionary *) extendedData roomID:(NSString *) roomID;

Room status change callback.

Parameters
state Changed room state
errorCode Error code, please refer to the for details
extendedData Extended Information with state updates. As the standby, only an empty json table is currently returned
roomID Room ID, a string of up to 128 bytes in length.

onRoomUserUpdate:userList:roomID:

- (void)onRoomUserUpdate:(ZegoUpdateType) updateType userList:(NSArray< ZegoUser * > *) userList roomID:(NSString *) roomID;

Notification callback for other users in the room to increase or decrease.

Parameters
updateType Update type (add/delete)
userList List of users changed in the current room
roomID Room ID where the user is logged in, a string of up to 128 bytes in length.

onRoomOnlineUserCountUpdate:roomID:

- (void)onRoomOnlineUserCountUpdate:(int) count roomID:(NSString *) roomID;

Notification callback of the number of online users in the room.

Parameters
count Count of online users
roomID Room ID where the user is logged in, a string of up to 128 bytes in length.

onRoomStreamUpdate:streamList:roomID:

- (void)onRoomStreamUpdate:(ZegoUpdateType) updateType streamList:(NSArray< ZegoStream * > *) streamList roomID:(NSString *) roomID;

Notification of increase or decrease of streams published by other users in the same room.

Parameters
updateType Update type (add/delete)
streamList Updated stream list
roomID Room ID where the user is logged in, a string of up to 128 bytes in length.

onRoomStreamExtraInfoUpdate:roomID:

- (void)onRoomStreamExtraInfoUpdate:(NSArray< ZegoStream * > *) streamList roomID:(NSString *) roomID;

Stream extra information update notification.

Parameters
streamList List of streams that the extra info was updated.
roomID Room ID where the user is logged in, a string of up to 128 bytes in length.

onPublisherStateUpdate:errorCode:extendedData:streamID:

- (void)onPublisherStateUpdate:(ZegoPublisherState) state errorCode:(int) errorCode extendedData:(nullable NSDictionary *) extendedData streamID:(NSString *) streamID;

Publish stream state callback.

Parameters
state Status of publishing stream
errorCode The error code corresponding to the status change of the publish stream. Please refer to the common error code documentation [] for details.
extendedData Extended information with state updates.
streamID Stream ID

onPublisherQualityUpdate:streamID:

- (void)onPublisherQualityUpdate:(ZegoPublishStreamQuality *) quality streamID:(NSString *) streamID;

Publish stream quality callback.

Parameters
quality Published stream quality, including audio and video frame rate, bit rate, resolution, RTT, etc.
streamID Stream ID

onPublisherCapturedAudioFirstFrame

- (void)onPublisherCapturedAudioFirstFrame:;

First frame callback notification for local audio captured.

onPublisherCapturedVideoFirstFrame:

- (void)onPublisherCapturedVideoFirstFrame:(ZegoPublishChannel) channel;

First frame callback notification for local video captured.

Parameters
channel Publishing stream channel.If you only publish one audio and video stream, you can ignore this parameter.

onPublisherVideoSizeChanged:channel:

- (void)onPublisherVideoSizeChanged:(CGSize) size channel:(ZegoPublishChannel) channel;

Video captured size change callback notification.

Parameters
size Video capture resolution
channel Publishing stream channel.If you only publish one audio and video stream, you can ignore this parameter.

onPublisherRelayCDNStateUpdate:streamID:

- (void)onPublisherRelayCDNStateUpdate:(NSArray< ZegoStreamRelayCDNInfo * > *) infoList streamID:(NSString *) streamID;

Add/Remove CDN address status callback.

Parameters
infoList List of information that the current CDN is relaying
streamID Stream ID

onPlayerStateUpdate:errorCode:extendedData:streamID:

- (void)onPlayerStateUpdate:(ZegoPlayerState) state errorCode:(int) errorCode extendedData:(nullable NSDictionary *) extendedData streamID:(NSString *) streamID;

Play stream state callback.

Parameters
state Current play state
errorCode The error code corresponding to the status change of the playing stream. Please refer to the common error code documentation [] for details.
extendedData Extended Information with state updates. As the standby, only an empty json table is currently returned
streamID stream ID

onPlayerQualityUpdate:streamID:

- (void)onPlayerQualityUpdate:(ZegoPlayStreamQuality *) quality streamID:(NSString *) streamID;

Play stream quality callback.

Parameters
quality Playing stream quality, including audio and video frame rate, bit rate, resolution, RTT, etc.
streamID Stream ID

onPlayerMediaEvent:streamID:

- (void)onPlayerMediaEvent:(ZegoPlayerMediaEvent) event streamID:(NSString *) streamID;

Play media event callback.

Parameters
event Play media event callback
streamID Stream ID

onPlayerRecvAudioFirstFrame:

- (void)onPlayerRecvAudioFirstFrame:(NSString *) streamID;

First frame callback notification for remote audio received.

Parameters
streamID Stream ID

onPlayerRecvVideoFirstFrame:

- (void)onPlayerRecvVideoFirstFrame:(NSString *) streamID;

First frame callback notification for remote video received.

Parameters
streamID Stream ID

onPlayerRenderVideoFirstFrame:

- (void)onPlayerRenderVideoFirstFrame:(NSString *) streamID;

First video frame is rendered.

Parameters
streamID Stream ID

onPlayerVideoSizeChanged:streamID:

- (void)onPlayerVideoSizeChanged:(CGSize) size streamID:(NSString *) streamID;

playing stream resolution change callback

Parameters
size The resolution of the video
streamID Stream ID

onPlayerRecvSEI:streamID:

- (void)onPlayerRecvSEI:(NSData *) data streamID:(NSString *) streamID;

Receive SEI.

Parameters
data SEI content
streamID Stream ID

onMixerRelayCDNStateUpdate:taskID:

- (void)onMixerRelayCDNStateUpdate:(NSArray< ZegoStreamRelayCDNInfo * > *) infoList taskID:(NSString *) taskID;

Mixed stream relay CDN status update notification.

Parameters
infoList List of information that the current CDN is being mixed
taskID Mix stream task ID

onMixerSoundLevelUpdate:

- (void)onMixerSoundLevelUpdate:(NSDictionary< NSNumber *, NSNumber * > *) soundLevels;

Callback when the soundLevel of every stream in the mix stream updated.

Parameters
soundLevels Sound level hash map, key is the soundLevelID of every single stream in this mixer stream, value is the sound level value of that single stream, value ranging from 0.0 to 100.0

onAudioDeviceStateChanged:updateType:deviceType:

- (void)onAudioDeviceStateChanged:(ZegoDeviceInfo *) deviceInfo updateType:(ZegoUpdateType) updateType deviceType:(ZegoAudioDeviceType) deviceType;

Audio device status change.

Parameters
deviceInfo Audio device information
updateType Update type (add/delete)
deviceType Audio device type

onVideoDeviceStateChanged:updateType:

- (void)onVideoDeviceStateChanged:(ZegoDeviceInfo *) deviceInfo updateType:(ZegoUpdateType) updateType;

Audio device status change.

Parameters
deviceInfo Audio device information
updateType Update type (add/delete)

onCapturedSoundLevelUpdate:

- (void)onCapturedSoundLevelUpdate:(NSNumber *) soundLevel;

Captured sound level update callback.

Parameters
soundLevel Locally captured sound level value, ranging from 0.0 to 100.0

onRemoteSoundLevelUpdate:

- (void)onRemoteSoundLevelUpdate:(NSDictionary< NSString *, NSNumber * > *) soundLevels;

Remote sound level update callback.

Parameters
soundLevels Remote sound level hash map, key is the streamID, value is the sound level value of the corresponding streamID, value ranging from 0.0 to 100.0

onCapturedAudioSpectrumUpdate:

- (void)onCapturedAudioSpectrumUpdate:(NSArray< NSNumber * > *) audioSpectrum;

Captured audio spectrum update callback.

Parameters
audioSpectrum Locally captured audio spectrum value list. Spectrum value range is [0-2^30]

onRemoteAudioSpectrumUpdate:

- (void)onRemoteAudioSpectrumUpdate:(NSDictionary< NSString *, NSArray< NSNumber * > * > *) audioSpectrums;

Remote audio spectrum update callback.

Parameters
audioSpectrums Remote audio spectrum hash map, key is the streamID, value is the audio spectrum list of the corresponding streamID. Spectrum value range is [0-2^30]

onDeviceError:deviceName:

- (void)onDeviceError:(int) errorCode deviceName:(NSString *) deviceName;

Device exception notification.

Parameters
errorCode The error code corresponding to the status change of the playing stream. Please refer to the common error code documentation [] for details
deviceName device name

onRemoteCameraStateUpdate:streamID:

- (void)onRemoteCameraStateUpdate:(ZegoRemoteDeviceState) state streamID:(NSString *) streamID;

Remote camera device status notification.

Parameters
state Remote camera status
streamID Stream ID

onRemoteMicStateUpdate:streamID:

- (void)onRemoteMicStateUpdate:(ZegoRemoteDeviceState) state streamID:(NSString *) streamID;

Remote microphone device status notification.

Parameters
state Remote microphone status
streamID Stream ID

onIMRecvBroadcastMessage:roomID:

- (void)onIMRecvBroadcastMessage:(NSArray< ZegoBroadcastMessageInfo * > *) messageList roomID:(NSString *) roomID;

Receive room broadcast message notification.

Parameters
messageList list of received messages.
roomID Room ID

onIMRecvBarrageMessage:roomID:

- (void)onIMRecvBarrageMessage:(NSArray< ZegoBarrageMessageInfo * > *) messageList roomID:(NSString *) roomID;

Receive room barrage message notification.

Parameters
messageList list of received messages.
roomID Room ID

onIMRecvCustomCommand:fromUser:roomID:

- (void)onIMRecvCustomCommand:(NSString *) command fromUser:(ZegoUser *) fromUser roomID:(NSString *) roomID;

Receive room custom command notification.

Parameters
command Command content received
fromUser Sender of the command
roomID Room ID