监听房间事件
更新时间: 2023/11/08 01:54:39
加入房间后,请增加 NERoom 房间的监听事件,便于及时获取相应的回调信息。
注意事项
需要在加入房间后进行事件监听。
事件列表
配置步骤
-
调用
getRoomContext
接口获取房间上下文。调用此方法时,您需要将
roomUuid
设置为您所加入房间的 ID。 -
调用
addRoomListener
接口监听房间里的事件。
示例代码
NERoomService roomService = NERoomKit.getInstance().getService(NERoomService.class);
NERoomContext roomContext = roomService.getRoomContext(roomUuid);
if (roomContext!=null){
roomContext.addRoomListener(new NERoomListener() {
@Override
public void onMemberRoleChanged(@NonNull NERoomMember member, @NonNull NERoomRole oldRole, @NonNull NERoomRole newRole) {
}
@Override
public void onMemberJoinRoom(@NonNull List<? extends NERoomMember> members) {
}
@Override
public void onMemberLeaveRoom(@NonNull List<? extends NERoomMember> members) {
}
@Override
public void onRoomEnded(@NonNull NERoomEndReason reason) {
}
@Override
public void onMemberJoinRtcChannel(@NonNull List<? extends NERoomMember> members) {
}
@Override
public void onMemberLeaveRtcChannel(@NonNull List<? extends NERoomMember> members) {
}
@Override
public void onRtcChannelError(int code) {
}
@Override
public void onMemberJoinChatroom(@NonNull List<? extends NERoomMember> members) {
}
@Override
public void onMemberLeaveChatroom(@NonNull List<? extends NERoomMember> members) {
}
@Override
public void onMemberAudioMuteChanged(@NonNull NERoomMember member, boolean mute, NERoomMember operateBy) {
}
@Override
public void onMemberVideoMuteChanged(@NonNull NERoomMember member, boolean mute, NERoomMember operateBy) {
}
@Override
public void onMemberScreenShareStateChanged(@NonNull NERoomMember member, boolean isSharing, NERoomMember operateBy) {
}
@Override
public void onReceiveChatroomMessages(@NonNull List<? extends NERoomMessage> messages) {
}
@Override
public void onMemberWhiteboardStateChanged(@NonNull NERoomMember member, boolean isSharing, NERoomMember operateBy) {
}
@Override
public void onWhiteboardError(int code, @NonNull String message) {
}
@Override
public void onRoomLiveStateChanged(@NonNull NELiveState state) {
}
@Override
public void onRoomLockStateChanged(boolean isLocked) {
}
@Override
public void onMemberNameChanged(@NonNull NERoomMember member, @NonNull String name) {
}
@Override
public void onRoomPropertiesChanged(@NonNull Map<String, String> properties) {
}
@Override
public void onRoomPropertiesDeleted(@NonNull Map<String, String> properties) {
}
@Override
public void onMemberPropertiesChanged(@NonNull NERoomMember member, @NonNull Map<String, String> properties) {
}
@Override
public void onMemberPropertiesDeleted(@NonNull NERoomMember member, @NonNull Map<String, String> properties) {
}
@Override
public void onRtcAudioVolumeIndication(@NonNull List<NEMemberVolumeInfo> volumes, int totalVolume) {
}
@Override
public void onRtcAudioOutputDeviceChanged(@NonNull NEAudioOutputDevice device) {
}
});
}
此文档是否对你有帮助?