EVENT | 描述 |
错误事件 | |
踢出房间事件 | |
当前用户被踢下线 | |
userSig 过期事件 | |
主持人销毁房间事件 | |
房间名称修改事件 | |
上麦模式修改事件 | |
所有成员麦克风使用权限改变事件 | |
所有成员发送消息状态改变事件 | |
房间最大麦位数修改事件 | |
远端用户进入房间事件 | |
远端用户离开房间事件 | |
用户角色改变事件 | |
用户视频状态改变事件 | |
用户音频状态改变事件 | |
用户发送消息状态事件 | |
用户音量改变事件 | |
用户网络质量改变事件 | |
麦位列表改变事件 | |
用户被踢下麦事件 | |
请求接收事件 | |
请求被处理事件 | |
请求取消事件 | |
设备变更事件 | |
屏幕分享停止事件 | |
房间内所有用户屏幕分享被禁用事件 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onError, (error) => {console.log('TUIRoomError error', error);})
参数 | 类型 | 含义 |
code | number | 错误代码 |
message | string | 错误信息 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onKickedOutOfRoom, ({ roomId, reason, message }) => {console.log('roomEngine.onKickedOutOfRoom', roomId, message);});
参数 | 类型 | 含义 |
roomId | string | 房间号 |
reason | 用户被踢出房间原因 | |
message | string | 踢出房间信息 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onKickedOffLine, ({ message }) => {console.log('roomEngine.onKickedOffLine', message);});
参数 | 类型 | 含义 |
roomId | string | 房间号 |
message | string | 用户在其他端登录信息 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onUserSigExpired, () => {console.log('roomEngine.onUserSigExpired');});
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onRoomDismissed, ({ roomId }) => {console.log('roomEngine.onRoomDismissed', roomId);});
参数 | 类型 | 含义 |
roomId | string | 房间号 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onRoomNameChanged, ({ roomId, roomName }) => {console.log('roomEngine.onRoomNameChanged', roomId, roomName);});
参数 | 类型 | 含义 |
roomId | string | 房间号 |
roomName | string | 房间名称 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onRoomSeatModeChanged, ({ roomId, seatMode }) => {console.log('roomEngine.onRoomSeatModeChanged', roomId, seatMode);});
参数 | 类型 | 含义 |
roomId | string | 房间号 |
seatMode | 房间上麦模式 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onAllUserCameraDisableChanged, ({ isDisable }) => {console.log('roomEngine.onAllUserCameraDisableChanged', isDisable);});
参数 | 类型 | 含义 |
isDisable | boolean | 是否允许使用摄像头 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onAllUserMicrophoneDisableChanged, ({ isDisable }) => {console.log('roomEngine.onAllUserMicrophoneDisableChanged', isDisable);});
参数 | 类型 | 含义 |
isDisable | boolean | 是否允许使用麦克风 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onSendMessageForAllUserDisableChanged, ({ isDisable }) => {console.log('roomEngine.onSendMessageForAllUserDisableChanged', isDisable);});
参数 | 类型 | 含义 |
isDisable | boolean | 是否允许发送文字消息 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onRoomMaxSeatCountChanged, ({ maxSeatNumber }) => {console.log('roomEngine.onRoomMaxSeatCountChanged', maxSeatNumber);});
参数 | 类型 | 含义 |
maxSeatNumber | number | 最大麦位数量 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onRemoteUserEnterRoom, ({ roomId, userInfo }) => {console.log('roomEngine.onRemoteUserEnterRoom', roomId, userInfo);});
参数 | 类型 | 含义 |
roomId | string | 房间号 |
userInfo | 用户信息 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onRemoteUserLeaveRoom, ({ roomId, userInfo }) => {console.log('roomEngine.onRemoteUserLeaveRoom', roomId, userInfo);});
参数 | 类型 | 含义 |
roomId | string | 房间号 |
userInfo | 用户信息 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onUserRoleChanged, ({ userId, userRole }) => {console.log('roomEngine.onUserRoleChanged', userId, userRole);});
参数 | 类型 | 含义 |
userId | string | 用户 ID |
userRole | 用户变更后的角色 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onUserVideoStateChanged, ({ userId, streamType, hasVideo, reason }) => {console.log('roomEngine.onUserVideoStateChanged', userId, streamType, hasVideo, reason);});
参数 | 类型 | 含义 |
userId | string | 用户 ID |
streamType | 用户流类型 | |
hasVideo | boolean | 是否有视频流 |
reason | 变更原因, 自己操作/主持人操作 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onUserAudioStateChanged, ({ userId, hasAudio, reason }) => {console.log('roomEngine.onUserAudioStateChanged', userId, hasAudio, reason);});
参数 | 类型 | 含义 |
userId | string | 用户 ID |
hasVideo | boolean | 是否有音频流 |
reason | 变更原因,自己操作/主持人操作 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onSendMessageForAllUserDisableChanged, ({ isDisable }) => {console.log('roomEngine.onSendMessageForAllUserDisableChanged', isDisable);});
参数 | 类型 | 含义 |
isDisable | boolean | 是否允许发送文字消息 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onUserVoiceVolumeChanged, ({ userVolumeList }) => {userVolumeList.forEach(userVolume => {console.log('roomEngine.onUserVoiceVolumeChanged', userVolume.userId, userVolume.volume);})});
参数 | 类型 | 含义 |
userVolumes | 房间内所有用户的音量, 包含 userId 及 volume 信息,volume 区间为 1~100; |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onUserNetworkQualityChanged, ({ userNetworkList }) => {userNetworkList.forEach(userNetwork => {console.log('roomEngine.onUserNetworkQualityChanged', userNetwork.userId, userNetwork.quality, userNetwork.upLoss, userNetwork.downLoss, userNetwork.delay);})});
参数 | 类型 | 含义 |
networkMap | 遍历网络质量等级 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onSeatControlEnabled, ({ enabled, maxSeatNumber }) => {console.log('roomEngine.onSeatControlEnabled', enabled, maxSeatNumber);});
参数 | 类型 | 含义 |
enabled | boolean | 是否启用 |
maxSeatNumber | number | 最大麦位数量 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onSeatListChanged, ({ seatList, seatedList, leftList }) => {console.log('roomEngine.onSeatListChanged',seatList, seatedList, leftList);});
参数 | 类型 | 含义 |
seatList | 麦位列表 | |
seatedList | 新增麦位信息 | |
leftList | 离开的麦位信息 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onKickedOffSeat, ({ userId }) => {console.log('roomEngine.onKickedOffSeat', userId);});
参数 | 类型 | 含义 |
userId | String | 被踢下麦的用户 ID |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onRequestReceived, ({ request }) => {console.log('roomEngine.onRequestReceived', request);});
参数 | 类型 | 含义 |
request | 请求信息 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onRequestProcessed, ({ request }) => {console.log('roomEngine.onRequestProcessed', request);});
参数 | 类型 | 含义 |
request | 请求信息 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onRequestCancelled, ({ requestId, userId }) => {console.log('roomEngine.onRequestCancelled', requestId, userId);});
参数 | 类型 | 含义 |
requestId | string | 请求 ID |
userId | string | 取消请求的用户 ID |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onDeviceChange, ({ deviceId, type, state }) => {console.log('roomEngine.onDeviceChange', deviceId, type, state);});
参数 | 类型 | 含义 |
deviceId | string | 设备 ID |
type | 设备类型 | |
state | 设备变更状态 |
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onUserScreenCaptureStopped, () => {console.log('roomEngine.onUserScreenCaptureStopped', deviceId, type, state);});
const roomEngine = new TUIRoomEngine();roomEngine.on(TUIRoomEvents.onScreenShareForAllUserDisableChanged, ({ isDisable }) => {console.log('roomEngine.onScreenShareForAllUserDisableChanged', isDisable);});
本页内容是否解决了您的问题?