switchRoom method

Future<void> switchRoom(
  1. TRTCSwitchRoomConfig config
)

Switch room. Allows users to quickly switch from one room to another

After this API is called, the original room will be exited, and audio/video data sending in the original room and audio/video playback to all remote users will be stopped, but the local video preview will be continued. After new room entry succeeds, the original audio/video data sending status will be automatically restored.

The API call result will be called back through TRTCCloudListener.onSwitchRoom.

Not supported on:

  • web

Implementation

Future<void> switchRoom(TRTCSwitchRoomConfig config) {
  return _cloudChannel!.invokeMethod('switchRoom', {
    "config": jsonEncode(config),
  });
}