Class: Listener

Listener~Listener()

new Listener()

Source:

Methods

getMapPeerIdToStream()

【desc】get g_mapPeerIdToStream
Source:

onAudioMuteToPeer(peerId, nickName, appData)

【desc】This function is called when a single member is muted(对单个成员静音时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
nickName string The user nickname(参会者的用户昵称)
appData string additional data(附加数据)
Source:

onAudioMuteToRoom(peerId, nickName, appData)

【desc】This function is called when all are muted(全体静音时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
nickName string The user nickname(参会者的用户昵称)
appData string additional data(附加数据)
Source:

onConnected()

【desc】This function is called when the connection to the server succeeds(连接服务器成功时调用此函数)
Source:

onConnectLost()

【desc】This function is called when disconnected from the server(与服务器断开连接时调用此函数)
Source:

onConnectRecover()

【desc】This function is called when the net recover with the server(与服务器恢复连接时调用此函数)
Source:

onCustomSignalToPeer(peerId, nickName, appData, eventName)

【desc】This function is called when an operation (for example, unmute) is performed on a member of a meeting or a member needs to be notified(对会议单个成员操作(如,解除静音)或需要通知单个成员时此函数被调用)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
nickName string The user nickname(参会者的用户昵称)
appData string additional data(附加数据)
eventName string user-defined message event name, corresponding to the event type when the sendControlMessage function parameter is a user-defined message(自定义消息事件名称,与sendControlMessage函数参数为自定义消息时的事件类型对应)
Source:

onCustomSignalToRoom(peerId, nickName, appData, eventName)

【desc】This function is invoked when all members of a meeting need to be unmuted or notified(对会议全体成员操作(如,解除全员静音)或需要通知全体成员时此函数被调用)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
nickName string The user nickname(参会者的用户昵称)
appData string additional data(附加数据)
eventName string user-defined message event name, corresponding to the event type when the sendControlMessage function parameter is a user-defined message(自定义消息事件名称,与sendControlMessage函数参数为自定义消息时的事件类型对应)
Source:

onDataStreamAvailable(streamId, streamInfo, available)

【desc】Text data streams are available.(文字数据流是可获得的)
Parameters:
Name Type Description
streamId string The literal stream ID (文字流ID)
streamInfo string The information of the stream.(文字流信息)
available boolean Literal data flow messages get identifiers,true:available;false:unavailable.(文字数据流消息可获得标识,true:可获得;false:不可获得)
Source:

onDataStreamMessage(streamId, binary, data)

【desc】Text data flow message callback function.(文字数据流消息回调函数)
Parameters:
Name Type Description
streamId string The literal stream ID (文字流ID)
binary boolean Whether the literal data stream is a binary identifier,true:binary;false:not binary(文字数据流是否是二进制标识,true:二进制;false:不是二进制)
data string The data of the literal stream.(文字流数据)
Source:

onEnterRoom(userList)

【desc】This function is called when the meeting is successfully entered(进入会议成功后调用此函数)
Parameters:
Name Type Description
userList Array An array list of users in a meeting(会议内用户信息数组列表)
Source:

onEnterRoomSuccess(info)

【desc】This function is called when the meeting is successfully entered(进入会议成功后调用此函数)
Parameters:
Name Type Description
info string The ID of the participant in the meeting(会议中的参会者ID)
Source:

onError(errorNo, errMsg)

【desc】This function is called when an error message is generated(当产生错误消息时该函数被调用)
Parameters:
Name Type Description
errorNo Number error code(错误码)
errMsg string error message(错误消息)
Source:

onErrorV2(errorNo, errMsg, info)

【desc】This function is called when an error message is generated(当产生错误消息时该函数被调用)
Parameters:
Name Type Description
errorNo Number error code(错误码)
errMsg string error message(错误消息)
info string additional information(附加信息)
Source:

onFirstVideoFrame(peerId, streamId)

【desc】This function is called when the first frame of the video is obtained(当视频第一帧获得时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
streamId string The audio stream ID of the participant(远程流ID)
Source:

onForbiddenChatToRoom(peerId, nickName, appData)

【desc】This function is called when all members are forbidden to speak(全员禁言时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
nickName string The user nickname(参会者的用户昵称)
appData string additional data(附加数据)
Source:

onPublishStream(type, streamId, streamName)

【desc】This function is called when the stream is successfully published.(当流发布成功的时候调用这个函数)
Parameters:
Name Type Description
type int The type of stream(1:local stream;2:screen or app stream;3:audio stream)(流的类型:1:本地流;2:屏幕或应用共享流;3:音频流)
streamId string The audio stream ID of the participant(远程流ID)
streamName string the remote stream name(远程流名称)
Source:

onRemoteAudioActived(streamId)

【desc】This function is called when remote user audio is activated(远程用户音频激活时时调用此函数)
Parameters:
Name Type Description
streamId string The audio stream ID of the participant(远程流ID)
Source:

onRemoteUserEnterRoom(peerId, nickname)

【desc】This function is called when a remote user joins a meeting(远程用户加入会议时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
nickname string The user nickname(参会者的用户昵称)
Source:

onRemoteUserLeaveRoom(peerId, reason)

【desc】This function is called when a remote user leaves a meeting(远程用户离开会议时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
reason Number the reasons of user departure(用户离开原因)
Source:

onSubscribeDataStreamSuccess(streamId)

【desc】Subscribing to the text stream is successful.(订阅文字数据流成功)
Parameters:
Name Type Description
streamId string The literal stream ID (文字流ID)
Source:

onUnForbiddenChatToRoom(peerId, nickName, appData)

【desc】This function is called when the full gag is lifted(解除全员禁言时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
nickName string The user nickname(参会者的用户昵称)
appData string additional data(附加数据)
Source:

onUploadRtcLogsFinish(error)

【desc】Upload RTC logs to complete the callback function.(上传RTC日志完成回调函数)
Parameters:
Name Type Description
error Number error code (错误码)
Source:

onUploadRtcLogsProgress(process)

【desc】Upload RTC log progress callback function.(上传RTC日志进度回调函数)
Parameters:
Name Type Description
process Number Upload progress (上传进度)
Source:

onUserAudioAvailable(peerId, streamId, bAvailable)

【desc】This function is called when the remote user's audio state(available/unavailable) changes(远程用户音频状态(可获得/不可获得)改变时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
streamId string The audio stream ID of the participant(远程流ID)
bAvailable boolean Whether the remote stream can obtain an identity(远程流是否可获得标识,ture:可获得;false:不可获得)
Source:

onUserAudioVolumes(volume)

【desc】This function is called when the user volume changes.(用户音量大小改变时调用此函数)
Parameters:
Name Type Description
volume string 音量信息,格式为: { "roomId":"173", "volumeInfos":[ { "peerId":"230845", "volume":-78 } ] }
Source:

onUserDesktopAvailable(peerId, streamId, streamName, bAvailable)

【desc】This function is called when the desktop shared stream state (available/unavailable) changes(桌面共享流状态(可获得/不可获得)变化时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
streamId string The audio stream ID of the participant(远程流ID)
streamName string the remote stream name(远程流名称)
bAvailable boolean Whether the remote stream can obtain an identity(远程流是否可获得标识,ture:可获得;false:不可获得)
Source:

onUserMessageReceived(peerId, nickName, msg)

【desc】This function is called when a user receives a chat message(用户接收到聊天消息时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
nickName string The user nickname(参会者的用户昵称)
msg string chat message(聊天消息内容)
Source:

onUserUpdateNickName(roomId, peerId, nickName)

【desc】This function is called when a user's nickname changes during a meeting(会议中用户昵称改变时调用此函数)
Parameters:
Name Type Description
roomId Number The meeting number(会议号)
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
nickName string The user nickname(参会者的用户昵称)
Source:

onUserVideoAvailable(peerId, streamId, streamName, bAvailable)

【desc】This function is called when the remote stream state (available/unavailable) changes(远程流状态(可获得/不可获得)变化时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
streamId string The audio stream ID of the participant(远程流ID)
streamName string the remote stream name(远程流名称)
bAvailable boolean Whether the remote stream can obtain an identity(远程流是否可获得标识,ture:可获得;false:不可获得)
Source:

onVideoCloseToPeer(peerId, nickName, appData)

【desc】This function is called when a video is closed for a single member(对单个成员关闭视频时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
nickName string The user nickname(参会者的用户昵称)
appData string additional data(附加数据)
Source:

onVideoCloseToRoom(peerId, nickName, appData)

【desc】This function is called when the video is closed for all members(对全部成员关闭视频时调用此函数)
Parameters:
Name Type Description
peerId Number The ID of the participant in the meeting(会议中的参会者ID)
nickName string The user nickname(参会者的用户昵称)
appData string additional data(附加数据)
Source: