changeMode method

Future<void> changeMode(
  1. Mode requestedMode
)

Changes the media mode of the local participant.

-The participant mode determines whether audio and video streams are produced, consumed, or used only for signaling.

Available Modes

  • Mode.SEND_AND_RECV: Both audio and video streams will be produced and consumed.

  • Mode.SIGNALLING_ONLY: Audio and video streams will neither be produced nor consumed. This mode is used only for signaling.

  • Mode.RECV_ONLY: Audio and video streams will only be consumed and not produced.

  • When the mode is successfully changed, a Events.participantModeChanged event is emitted with the participantId and the updated mode of the participant.

Parameters

Events associated with changeMode()

Example

// Change participant mode to send and receive media
await room.changeMode(Mode.SEND_AND_RECV);

room.on(Events.participantModeChanged, (event) {
  print(
    'Participant ${event.participantId} changed mode to ${event.mode}',
  );
});

Implementation

Future<void> changeMode(Mode requestedMode) => _changeMode(requestedMode);