A Room defined with either group
or lecture
mode, may be switched to the other mode at runtime, i.e. in an ongoing session. EnxRoom.switchRoomMode()
method is executed by moderator to switch to other mode instantly.
When a room is switched from group
to lecture
mode:
- All participant’s audio/video streams are dropped from the room with a notification to each participants.
- All the features of Lecture mode such as Floor Access Control are activated.
- All active Break-Out Rooms get terminated.
On the other hand, when a room is switched from lecture
to group
mode:
- A notification is sent to each participant and allows them to publish own audio/video streams into the room.
- Due to privacy concern, SDK doesn’t automatically starts publishing audio/video stream in such case, but Developers needs to take decision whether to publish automatically or to prompt participants to publish.
Class: EnxRoom
Observer: EnxSwitchRoomObserver
Methods:
public void switchRoomMode(String roomMode)
Parameters:
roomMode
– String. Enumerated valueslecture
,group
. Use the mode to switch into.
Callbacks:
onAckSwitchedRoom
– Acknowledgment to the Moderator with status of the request.onRoomModeSwitched
– Notification to everyone in the Room that the switch has been switch to the other mode.
enxRoom.setEnxSwitchRoomObserver(this); enxRoom.switchRoomMode("group"); // To switch to group mode // Moderator is acknowledged public void onAckSwitchedRoom(JSONObject jsonobject){ /* JSONObject example: { "result": 1715, "moderator": "String", "msg": "Room switched to lecture mode", "mode": "lecture" } */ } // Everyone is notified public void onRoomModeSwitched(JSONObject jsonObject){ /* JSONObject example: { "result": 1715, "moderator": "String", "msg": "Room switched to lecture mode", "mode": "lecture" } */ }
Error Codes & Exceptions:
Code | Description |
---|---|
5003 | Unauthorized Access. When a user with participant role invokes switchRoomMode() |
5126 | Invalid Room Mode |
5086 | Room is not connected |
5136 | Non-Contextual Method Call |
1716 | Room is in lecture mode. Trying to switch to lecture mode being in lecture mode. |
1717 | Room is in group mode. Trying to switch to group mode being in group mode. |