Tutorial: cross-room

cross-room

Cross Room API

Start Cross Room Call

Connecting current room to target room so that the anchors in both rooms can subscribe to each other's streams.

// Specify the target roomId(string) at the opposite end of the cross-room. 
// Then, the two rooms are fully connected, and the anchors can subscribe stream from another room.
await client.callExperimentalAPI('connectOtherRoom', { roomId: '6666' });

Update Cross Room

You can use this API to mute the stream from target room to current room.

const options = {
  updateList: [{
    roomId: '6666',
    userId: 'userA_6666', // userId from other room, such as '6666'
    muteAudio: true, 
    muteVideo: true,
    muteAuxiliary: true,
  }]
}
await client.callExperimentalAPI('updateOtherRoomForwardMode', options);

Stop Cross Room

await client.callExperimentalAPI('disconnectOtherRoom', { roomId: '6666' });