Callback 回调

onLogin(result, reason)

登录结果回调
Parameters:
Name Type Description
result Boolean 回调结果 true/false
reason Number 登录失败原因,result为false时有用,参考频道加入失败和离开原因

onQuery(result, isExist, queryInfo)

查询频道信息结果回调
Parameters:
Name Type Description
result Boolean 回调结果 true/false
isExist Boolean 会议是否存在,回调结果 true/false
queryInfo Object 查询到的频道信息
Properties
Name Type Description
MtcConfCapacityKey String 会议最大人数
MtcConfClientCountKey String 支持的最大发送人数
MtcConfIsVideoKey Boolean 是否为视频会议
MtcConfMemberListKey Array 成员列表
MtcConfNumberKey Number 会议ChannelId
MtcConfStartTimeKey Number 会议开始时间戳
MtcConfTitleKey String 会议标题
MtcConfUriKey String 会议uri
MtcRegionDescKey String 区域描述
MtcRegionIdKey Number 区域ID
MtcRegionNameKey String 区域名

onJoin(result)

加入会议回调
Parameters:
Name Type Description
result Boolean 回调结果 true/false

onTrace(txt) → {string}

日志打印上报
Parameters:
Name Type Description
txt String 日志打印上报
Returns:
-返回字符串
Type
string

onEnableRecord(result)

开启/关闭录制回调
Parameters:
Name Type Description
result Boolean 回调结果true/false

onEnableCdn(result)

开启/关闭CDN推流回调
Parameters:
Name Type Description
result Boolean 回调结果true/false

onStartVideo(result)

视频渲染回调
Parameters:
Name Type Description
result Boolean 回调结果true/false

onMediaChannelStateChange(oldState, state)

自身频道状态变化回调
Parameters:
Name Type Description
oldState String 之前的状态
state String 当前的状态

onParticipantJoin(participant)

成员加入回调
Parameters:
Name Type Description
participant Object 成员对象
内容查看getParticipants

onParticipantUpdate(participant, changeParam, changeValue)

成员列表更新回调
Parameters:
Name Type Description
participantName String 成员昵称
changeParam String 成员更新参数
isAudio音频
isVideo视频
displayName昵称
customRole自定义角色
customState自定义状态
changeValue String 成员更新参数值

onParticipantLeft(participant)

成员离开回调
Parameters:
Name Type Description
participant Object 成员对象

onSetParticipant(result)

设置角色、昵称、状态回调
Parameters:
Name Type Description
result Boolean 回调结果true/false

onSwitchCamera(result)

切换摄像头回调
Parameters:
Name Type Description
result Boolean 回调结果true/false

onSwitchMicrophone(result)

切换麦克风回调
Parameters:
Name Type Description
result Boolean 回调结果true/false

onSwitchSpeaker(result)

切换扬声器回调
Parameters:
Name Type Description
result Boolean 回调结果true/false

onEnableScreenShareStart(result)

开启屏幕共享回调
Parameters:
Name Type Description
result Boolean 回调结果true/false

onEnableScreenShareEnd(result)

关闭屏幕共享回调
Parameters:
Name Type Description
result Boolean 回调结果true/false

onSendMessage(result)

消息是否发送成功回调
Parameters:
Name Type Description
result Boolean 回调结果true/false

onReceiveIM(name, messageContent)

收到im消息回调
Parameters:
Name Type Description
name String 成员名称
messageContent String 消息内容

onReceiveOnlineMessage(name, messageContent)

收到onlineMessage消息回调
Parameters:
Name Type Description
name String 成员名称
messageContent String 消息内容

onReceiveMessageText(name, messageContent)

收到会议聊天文本消息回调
Parameters:
Name Type Description
name String 成员名称
messageContent String 消息内容

onSendCommand(name, result)

发送指令回调
Parameters:
Name Type Description
name String 指令类型
result Boolean 发送指令结果 true/false

onSetLayout(result)

设置布局回调
Parameters:
Name Type Description
result Boolean 回调结果true/false

onGetChannelProperties(custom)

会议信息自定义改变回调
Parameters:
Name Type Description
custom Object 改变的自定义对象
Returns:
-返回JSON字符串
Type
String

onLeave(result)

离开会议回调
Parameters:
Name Type Description
result Boolean 回调结果true/false

onLogout(reason)

登出回调
Parameters:
Name Type Description
reason Number 登出原因,参考频道加入失败和离开原因

onError(err, type)

错误提示
Parameters:
Name Type Description
err String | Object 错误原因
type String 错误类型
login登录时报错
join加入会议时报错
startVideo打开摄像头时报错
getDevice获取媒体设备时报错
switch切换音视频时报错
call在call时报错
disconnected断开连接时报错
screenShare屏幕共享报错
其他错误