addDevice

View as Markdown

addDevice

Adds a device to the room. Using this method, a user can stream multiple sources at the same time. If you need to add a camera device or a microphone device, you can alternatively use the more specific methods addCamera and addMicrophone.

Parameters

opts
object

Specify the constraints for the device. In addition, you can add the autoJoin key to specify whether the device should immediately join the room or joining will be performed manually later.

audio
boolean | MediaTrackConstraints

Audio constraints.

autoJoin
boolean

Whether the device should automatically join the room. Default: true.

video
boolean | MediaTrackConstraints

Video constraints.

Returns

Promise<RoomSessionDevice> - See RoomSessionDevice documentation for more details.

Permissions

  • room.self.additional_source

You need to specify the permissions when creating the Video Room Token on the server side.

Example

Adding any of the microphone devices to the room (duplicate streams are possible):

1await roomSession.addDevice({ audio: true });