A Room defined with either group or lecture mode, may be switched to the other mode at runtime, i.e. in an ongoing session. EnxRtc.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: EnxRtc

Methods: static Future<void> switchRoomMode(String mode)

Parameters:

  • mode – String. Enumerated values lecture, 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.
EnxRtc.switchRoomMode(mode).   //To switch to group mode  mode =group/lecture

EnxRtc.onAckSwitchedRoom=(Map<dynamic,dynamic> map){
// Moderator is acknowledged
};
EnxRtc.onRoomModeSwitched=(Map<dynamic,dynamic> map){
// Everyone is notified
};

Error Codes & Exceptions:

CodeDescription
5003Unauthorized Access. When a user with participant role invokes switchRoomMode()
5126Invalid Room Mode
5086Room is not connected
5136Non-Contextual Method Call
1716 Room is in lecture mode. Trying to switch to lecture mode being in lecture mode.
1717Room is in group mode. Trying to switch to group mode being in group mode.