startScreenShare

View as Markdown

startScreenShare

Adds a screen sharing instance to the room. You can create multiple screen sharing instances and add all of them to the room.

Parameters

opts
object

Object containing the parameters of the method.

audio
boolean | MediaTrackConstraints

Audio constraints to use when joining the room. Default: false.

autoJoin
boolean

Whether the screen share object should automatically join the room. Default: true.

layout
string

Layout to switch to as soon as the screen share joins the room.

positions
VideoPositions

Layout positions to assign as soon as the screen share joins the room.

video
boolean | MediaTrackConstraints

Video constraints to use when joining the room. Default: true.

Returns

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

Permissions

  • room.self.screenshare

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

Examples

Sharing the screen together with the associated audio:

1await roomSession.startScreenShare({ audio: true, video: true });

Sharing the screen while changing layout:

1await roomSession.startScreenShare({
2 audio: true,
3 video: true,
4 layout: "screen-share",
5 positions: {
6 self: "reserved-1",
7 },
8});