change Mode
Changes the room mode of the local participant.
Events:
RoomEventListener.onParticipantModeChanged — emitted on all participants when the mode changes
ParticipantEventListener.onStreamEnabled / onStreamDisabled — emitted for the streams the new mode starts or stops
RoomEventListener.onPresenterChanged — emitted with
nullif the local participant's screen share is closed
Asking for the mode the room is already in changes nothing and throws VideoSDKException with code 3054 (ERROR_ALREADY_IN_REQUESTED_STATE); a call that lands while an earlier changeMode is still running throws 3055 (ERROR_OPERATION_IN_PROGRESS). Neither is reported on RoomEventListener.onError.
Called before the room is joined, or while it is reconnecting, the mode is left unchanged and RoomEventListener.onError fires with code 3035 (ERROR_ACTION_PERFORMED_BEFORE_ROOM_JOINED) or 3065 (ERROR_ROOM_RECONNECTING). Nothing is thrown in those two cases.
A change the server refuses leaves the mode as it was, throws, and is also reported on RoomEventListener.onError.
Moving back to Mode.SEND_AND_RECV restores the microphone and camera as they were before the move down: a muted microphone stays off, a camera that was on comes back. For someone who joined in a lower mode, micEnabled / camEnabled from VideoSDK.createRoom decide instead.
Parameters
the new room mode.
Throws
code 3054 (ERROR_ALREADY_IN_REQUESTED_STATE) if the room is already in mode, code 3055 (ERROR_OPERATION_IN_PROGRESS) if a change is already in progress, or code 4065 (CHANGE_MODE_FAILED) — or the server's own code — if the server refuses.