change Mode
This method can be used to change the meeting mode of the local participant.
Events:
onParticipantModeChanged— emitted on all participants when the mode changesonStreamEnabled/onStreamDisabled— emitted on the local participant if streams are added/removed due to the mode transitiononPresenterChanged— emitted withnullif the participant had an active screen share that is closed
Code Example:
// Switch to send-and-receive mode
meeting.changeMode("SEND_AND_RECV")
Two cases throw Error on the calling thread: asking for the mode the meeting is already in, and passing a name that is not a MeetingMode. That is java.lang.Error, not an Exception, so a surrounding catch (Exception e) will not stop it — check getMode on the local participant before calling, or catch Throwable.
A null mode changes nothing and reports nothing — no event fires and no exception reaches the caller.
Called before the meeting is joined, or while it is reconnecting, the mode is left unchanged and onError fires with code 3001 (ERROR_ACTION_PERFORMED_BEFORE_MEETING_JOINED) or 3014 (ERROR_MEETING_RECONNECTING). Nothing is thrown in those two cases.
Parameters
the new meeting mode — "SEND_AND_RECV", "RECV_ONLY", or "SIGNALLING_ONLY". See MeetingMode for all available modes.
Throws
if the meeting is already in mode, or mode is not a MeetingMode name