---title: RoomSessionsidebar_position: 0tags: - Browser SDK - Video---import MethodOff from ../../_common/_method_off.mdx;import MethodOn from ../../_common/_method_on.mdx;import MethodOnce from ../../_common/_method_once.mdx;import MethodRemoveAllListeners from ../../_common/_method_removealllisteners.mdx;A RoomSession allows you to start and control video sessions.For example, the following code joins a video session and listens for new members joining:javascriptconst roomSession = new SignalWire.Video.RoomSession({ token: , rootElement: document.getElementById(myVideoElement),});roomSession.on(member.joined, (e) => { console.log(${e.member.name} joined);});roomSession.join();### Obtaining a tokenPlease refer to the [Simple Video Demo](guides/video-api/getting-started/getting-started-with-the-signalwire-video-api-1/index.mdx) guide to learn how to obtain Video Room tokens.## Constructors### constructor• **new RoomSession**(opts)Creates a new RoomSession. Note that the room will not be joined until [join](#join) has been called.#### Parameters| Name | Type | Description || :------------------------------- | :------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------- || opts | Object | - || opts.token | string | SignalWire video room token (get one from the [REST APIs](pathname:///rest/generate-a-new-video-room-token)) || opts.rootElement? | [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) | HTML element in which to display the video stream. || opts.applyLocalVideoOverlay? | boolean | Whether to apply the local-overlay on top of your video. Default: true. || opts.iceServers? | [RTCIceServer](https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer)[] | List of ICE servers. || opts.localStream? | [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream) | A custom media stream to use in place of a camera. || opts.logLevel? | trace \| debug \| info \| warn \| error \| silent | Logging level. || opts.speakerId? | string | Id of the speaker device to use for audio output. If undefined, picks a default speaker. || opts.stopCameraWhileMuted? | boolean | Whether to stop the camera when the member is muted. Default: true. || opts.stopMicrophoneWhileMuted? | boolean | Whether to stop the microphone when the member is muted. Default: true. || opts.audio? | boolean \| [MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints) | Audio constraints to use when joining the room. Default: true. _Deprecated: please use the equivalent parameter in [join](#join)._ || opts.video? | boolean \| [MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints) | Video constraints to use when joining the room. Default: true. _Deprecated: please use the equivalent parameter in [join](#join)._ |#### Examplejavascriptconst roomSession = new SignalWire.Video.RoomSession({ token: , rootElement: document.getElementById(myVideoElement),});## Properties### active• Readonly **active**: booleanWhether the connection is currently active.---### cameraId• Readonly **cameraId**: null \| stringThe id of the video device, or null if not available.---### cameraLabel• Readonly **cameraLabel**: null \| stringThe label of the video device, or null if not available.---### deviceList• Readonly **deviceList**: [RoomSessionDevice](./video-roomsessiondevice.md)[]Contains any additional devices added via [addCamera](./video-roomsession.mdx#addcamera), [addMicrophone](./video-roomsession.mdx#addmicrophone), or [addDevice](./video-roomsession.mdx#adddevice).---### interactivityMode• Readonly **interactivityMode**: audience|memberThe current interactivity mode (_member_ or _audience_) for the local member.Member participants are allowed to transmit their own audio and/or video to therest of the room (as in a typical video conference), while audience participantscan only view and/or listen. See [join](#join).---### localAudioTrack• Readonly **localAudioTrack**: null \| MediaStreamTrackProvides access to the local audio [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).---### localStream• Readonly **localStream**: undefined \| MediaStreamProvides access to the local [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream).---### localVideoTrack• Readonly **localVideoTrack**: null \| MediaStreamTrackProvides access to the local video [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).---### localOverlay• Readonly **localOverlay**: [LocalOverlay](./video-localoverlay.md)Provides access to the local video overlay. Use this for example to mirror the local video.---### memberId• Readonly **memberId**: stringThe id of the current member within the room.---### microphoneId• Readonly **microphoneId**: null \| stringThe id of the audio input device, or null if not available.---### microphoneLabel• Readonly **microphoneLabel**: null \| stringThe label of the audio input device, or null if not available.---### permissions• Readonly **permissions**: string[]The list of permissions currently available to the local member.---### previewUrl• Optional Readonly **previewUrl**: stringIf the Room has been created with the property enable_room_previews set to true, this field contains the URL to the room preview.---### remoteStream• Readonly **remoteStream**: undefined \| MediaStreamProvides access to the remote [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream).---### roomId• Readonly **roomId**: stringThe unique identifier for the room.---### roomSessionId• Readonly **roomSessionId**: stringThe unique identifier for the room session.---### screenShareList• Readonly **screenShareList**: [RoomSessionScreenShare](./video-roomsessionscreenshare.md)[]Contains any local screen shares added to the room via [startScreenShare](./video-roomsession.mdx#startscreenshare).---## Methods### addCamera▸ **addCamera**(opts): Promise<[RoomSessionDevice](./video-roomsessiondevice.md)\>Adds a camera device to the room. Using this method, a user can stream multiple video sources at the same time.#### Parameters| Name | Type | Description || :----- | :--------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- || opts | MediaTrackConstraints & { autoJoin?: boolean } | 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. |#### ReturnsPromise<[RoomSessionDevice](./video-roomsessiondevice.md)\>#### Permissions- room.self.additional_sourceYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesAdding any of the camera devices to the room (duplicate streams are possible):javascriptawait roomSession.addCamera();Adding a specific camera:javascriptawait roomSession.addCamera({ deviceId: gOtMHwZdoA6wMlAnhbfTmeRgPAsqa7iw1OwgKYtbTLA=,});Adding a high-resolution camera, joining it manually:javascriptconst roomDev = await roomSession.addCamera({ autoJoin: false, width: { min: 1280 },});await roomDev.join();---### addDevice▸ **addDevice**(opts): Promise<[RoomSessionDevice](./video-roomsessiondevice.md)\>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](./video-roomsession.mdx#addcamera) and [addMicrophone](./video-roomsession.mdx#addmicrophone).#### Parameters| Name | Type | Description || :--------------- | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- || 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. || opts.audio? | boolean \| MediaTrackConstraints | Audio constraints. || opts.autoJoin? | boolean | Whether the device should automatically join the room. Default: true. || opts.video? | boolean \| MediaTrackConstraints | Video constraints. |#### ReturnsPromise<[RoomSessionDevice](./video-roomsessiondevice.md)\>#### Permissions- room.self.additional_sourceYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExampleAdding any of the microphone devices to the room (duplicate streams are possible):javascriptawait roomSession.addDevice({ audio: true });---### addMicrophone▸ **addMicrophone**(opts): Promise<[RoomSessionDevice](./video-roomsessiondevice.md)\>Adds a microphone device to the room. Using this method, a user can stream multiple audio sources at the same time.#### Parameters| Name | Type | Description || :----- | :--------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- || opts | MediaTrackConstraints & { autoJoin?: boolean } | 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. |#### ReturnsPromise<[RoomSessionDevice](./video-roomsessiondevice.md)\>#### Permissions- room.self.additional_sourceYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesAdding any of the microphone devices to the room (duplicate streams are possible):javascriptawait roomSession.addMicrophone();Adding a specific microphone:javascriptawait roomSession.addMicrophone({ deviceId: PIn/IIDDgBUHzJkhRncv1m85hX1gC67xYIgJvvThB3Q=,});Adding a microphone with specific constraints, joining it manually:javascriptconst roomDev = await roomSession.addMicrophone({ autoJoin: false, noiseSuppression: true,});await roomDev.join();---### audioMute▸ **audioMute**(params?): PromisePuts the microphone on mute. The other participants will not hear audio from the muted participant anymore. You can use this method to mute either yourself or another participant in the room.#### Parameters| Name | Type | Description || :----------------- | :------- | :---------------------------------------------------------------------------------- || params? | Object | - || params.memberId? | string | Id of the member to mute. If omitted, mutes the default device in the local client. |#### ReturnsPromise#### Permissions- room.self.audio_mute: to mute a local device.- room.member.audio_mute: to mute a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesMuting your own microphone:javascriptawait roomSession.audioMute();Muting the microphone of another participant:javascriptconst id = de550c0c-3fac-4efd-b06f-b5b8614b8966; // you can get this from getMembers()await roomSession.audioMute({ memberId: id });---### audioUnmute▸ **audioUnmute**(params?): PromiseUnmutes the microphone if it had been previously muted. You can use this method to unmute either yourself or another participant in the room.#### Parameters| Name | Type | Description || :----------------- | :------- | :-------------------------------------------------------------------------------------- || params? | Object | - || params.memberId? | string | Id of the member to unmute. If omitted, unmutes the default device in the local client. |#### ReturnsPromise#### Permissions- room.self.audio_unmute: to unmute a local device.- room.member.audio_unmute: to unmute a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesUnmuting your own microphone:javascriptawait roomSession.audioUnmute();Unmuting the microphone of another participant:javascriptconst id = de550c0c-3fac-4efd-b06f-b5b8614b8966; // you can get this from getMembers()await roomSession.audioUnmute({ memberId: id });---### ~~createScreenShareObject~~▸ **createScreenShareObject**(opts): Promise<[RoomSessionScreenShare](./video-roomsessionscreenshare.md)\>> ⚠️ Deprecated.> Use [startScreenShare](./video-roomsession.mdx#startscreenshare) instead.Adds a screen sharing instance to the room. You can create multiple screen sharing instances and add all of them to the room.#### Parameters| Name | Type | Description || :--------------- | :----------------------------------- | :------------------------------------------------------------------ || opts | Object | - || opts.audio? | boolean \| MediaTrackConstraints | Audio constraints to use when joining the room. Default: true. || opts.autoJoin? | boolean | Whether the screen share object should automatically join the room. || opts.video? | boolean \| MediaTrackConstraints | Video constraints to use when joining the room. Default: true. |#### ReturnsPromise<[RoomSessionScreenShare](./video-roomsessionscreenshare.md)\>#### Permissions- room.self.screenshareYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExampleSharing the screen together with the associated audio:javascriptawait roomSession.createScreenShareObject({ audio: true, video: true });---### deaf▸ **deaf**(params?): PromiseMutes the incoming audio. The affected participant will not hear audio from the other participants anymore. You can use this method to make deaf either yourself or another participant in the room.Note that in addition to making a participant deaf, this will also automatically mute the microphone of the target participant (even if there is no audio_mute permission). If you want, you can then manually unmute it by calling [audioUnmute](./video-roomsession.mdx#audiounmute).#### Parameters| Name | Type | Description || :----------------- | :------- | :-------------------------------------------------------------------------------------- || params? | Object | - || params.memberId? | string | Id of the member to affect. If omitted, affects the default device in the local client. |#### ReturnsPromise#### Permissions- room.self.deaf: to make yourself deaf.- room.member.deaf: to make deaf a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesMaking yourself deaf:javascriptawait roomSession.deaf();Making another participant deaf:javascriptconst id = de550c0c-3fac-4efd-b06f-b5b8614b8966; // you can get this from getMembers()await roomSession.deaf({ memberId: id });---### deleteMemberMeta▸ **deleteMemberMeta**(params): PromiseDeletes the specified keys from the metadata for the specified member.#### Parameters| Name | Type | Description || :----------------- | :--------- | :------------------------------------------------------------------ || params | Object | - || params.memberId? | string | Id of the member to affect. If omitted, affects the current member. || params.keys | string[] | The keys to remove. |#### ReturnsPromise#### Permissions- room.set_metaYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplejsroomSession.on(member.updated, (e) => { // We can set an event listener to log changes to the metadata. console.log(e.member.meta);});await roomSession.setMemberMeta({ memberId: ..., meta: { foo: bar, baz: true },});// The logger will now print { foo: bar, baz: true }await roomSession.deleteMemberMeta({ memberId: ..., keys: [foo] });// The logger will now print { baz: true }---### deleteMeta▸ **deleteMeta**(keys): PromiseDeletes the specified keys from the metadata for this RoomSession.#### Parameters| Name | Type | Description || :----- | :--------- | :------------------ || keys | string[] | The keys to remove. |#### ReturnsPromise#### Permissions- room.set_metaYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplejsroomSession.on(room.updated, (e) => { // We can set an event listener to log changes to the metadata. console.log(e.room.meta);});await roomSession.setMeta({ foo: bar, baz: true });// The logger will now print { foo: bar, baz: true }await roomSession.deleteMeta([foo]);// The logger will now print { baz: true }---### demote▸ **demote**(params): PromiseDemotes a participant from member to audience. See [join](#join) and [promote](#promote).#### Parameters| Name | Type | Description || :--------------------- | :------------------------------------------ | :--------------------------------------------------------------------------------------------------------------- || params | Object | - || params.memberId? | string | Id of the member to affect. If omitted, affects the current member. || params.mediaAllowed? | all \| audio-only \| video-only | Specifies the media that the client will be allowed to _receive_. An audience participant cannot send any media. |#### ReturnsPromise#### Permissions- room.member.demoteYou need to specify the permissions when [creating the Video Room Token](https://developer.signalwire.com/apis/reference/create_room_token) on the server side.#### Examplejavascriptawait roomSession.demote({ memberId: de550c0c-3fac-4efd-b06f-b5b8614b8966, mediaAllowed: all,});---### destroy▸ **destroy**(): voidDestroys the room object. This only destroys the JavaScript object: it has no effect on the server-side room.#### Returnsvoid---### getLayouts▸ **getLayouts**(): Promise<{ layouts: string[] }\>Returns a list of available layouts for the room. To set a room layout, use [setLayout](./video-roomsession.mdx#setlayout).#### ReturnsPromise<{ layouts: string[] }\>#### Permissions- room.list_available_layoutsYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejavascriptawait roomSession.getLayouts()// returns:{ layouts: [ 8x8, 2x1, 1x1, 5up, 5x5, 4x4, 10x10, 2x2, 6x6, 3x3, grid-responsive, highlight-1-responsive ]}---### getMembers▸ **getMembers**(): Promise<{ members: VideoMemberEntity[] }\>Returns a list of members currently in the room.#### ReturnsPromise<{ members: VideoMemberEntity[] }\>#### Examplejavascriptawait roomSession.getMembers()// returns:{members: [ { visible: true, room_session_id: fde15619-13c1-4cb5-899d-96afaca2c52a, input_volume: 0, id: 1bf4d4fb-a3e4-4d46-80a8-3ebfdceb2a60, input_sensitivity: 50, output_volume: 0, audio_muted: false, name: Mark, deaf: false, video_muted: false, room_id: aae25822-892c-4832-b0b3-34aac3a0e8d1, type: member }, { visible: true, room_session_id: fde15619-13c1-4cb5-899d-96afaca2c52a, input_volume: 0, id: e0c5be44-d6c7-438f-8cda-f859a1a0b1e7, input_sensitivity: 50, output_volume: 0, audio_muted: false, name: David, deaf: false, video_muted: false, room_id: aae25822-892c-4832-b0b3-34aac3a0e8d1, type: member }]}---### getMemberMeta▸ **getMemberMeta**(): Promise<{ meta: Object }\>Returns the metadata assigned to the specified member.#### Parameters| Name | Type | Description || :----------------- | :------- | :------------------------------------------------------------------------------------------- || params? | Object | - || params.memberId? | string | Id of the member for which to obtain the metadata. If omitted, refers to the current member. |#### ReturnsPromise<{ meta: Object }\>#### Examplejavascriptconst { meta } = await roomSession.getMemberMeta();console.log(meta);---### getMeta▸ **getMeta**(): Promise<{ meta: Object }\>Returns the metadata assigned to this Room Session.#### ReturnsPromise<{ meta: Object }\>#### Examplejavascriptconst { meta } = await roomSession.getMeta();console.log(meta);---### getPlaybacks▸ **getPlaybacks**(): Promise<{ playbacks: [RoomSessionPlayback](./video-roomsessionplayback.md) }\>Obtains a list of recordings for the current room session.#### ReturnsPromise<{ playbacks: [RoomSessionPlayback](./video-roomsessionplayback.md) }\>#### Permissions- room.playbackYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejsconst pl = await roomSession.getPlaybacks();if (pl.playbacks.length > 0) { console.log(rec.playbacks[0].id, recs.playbacks[0].state);}---### getRecordings▸ **getRecordings**(): Promise<{ recordings: [RoomSessionRecording](./video-roomsessionrecording.md) }\>Obtains a list of recordings for the current room session. To download the actual mp4 file, please use the [REST API](pathname:///rest/).#### ReturnsPromise<{ recordings: [RoomSessionRecording](./video-roomsessionrecording.md) }\>#### Permissions- room.recordingYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejavascriptconst recs = await roomSession.getRecordings();if (recs.recordings.length > 0) { console.log(recs.recordings[0].id, recs.recordings[0].duration);}From your server, you can obtain the mp4 file using the [REST API](pathname:///rest/):bashcurl --request GET \ --url https://.signalwire.com/api/video/room_recordings/ \ --header Accept: application/json \ --header Authorization: Basic ---### getStreams▸ **getStreams**(): Promise<{ streams: [RoomSessionStream](./video-roomsessionstream.mdx) }\>Obtains a list of active streams for this RoomSession. These are RTMP streams ofthe audio/video content of this room, which will be sent to an external party(e.g., to YouTube).#### ReturnsPromise<{ streams: [RoomSessionStream](./video-roomsessionstream.mdx) }\>#### Permissions- room.streamYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejavascriptconst s = await roomSession.getStreams();for (const stream of s.streams) { console.log(stream.id, stream.url);}---### ~~hideVideoMuted~~▸ **hideVideoMuted**(): Promise> ⚠️ Deprecated.> Use [setHideVideoMuted](./video-roomsession.mdx#sethidevideomuted) instead.Do not show muted videos in the room layout.#### ReturnsPromise#### Permissions- room.hide_video_mutedYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejavascriptawait roomSession.hideVideoMuted();---### join▸ **join**(): PromiseJoins the room session.Depending on the token you passed to the constructor, the room could be joinedas a _member_ or as an _audience_ participant.#### Parameters| Name | Type | Description || :--------------------- | :-------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- || params | Object | - || params.audio? | [MediaStreamConstraints[audio]][media-stream-constraints] | Audio constraints to use when joining the room. Default: true. || params.video? | [MediaStreamConstraints[video]][media-stream-constraints] | Video constraints to use when joining the room. Default: true. || params.receiveAudio? | boolean | Whether to receive audio. Default: true. || params.receiveVideo? | boolean | Whether to receive video. Default: true. || params.sendAudio? | boolean | Whether to send audio. This is ignored if the token belongs to an audience member, since they cannot send audio. Default: true. || params.sendVideo? | boolean | Whether to send video. This is ignored if the token belongs to an audience member, since they cannot send video. Default: true. |#### ReturnsPromise---### leave▸ **leave**(): PromiseLeaves the room. This detaches all the locally originating streams from the room.#### ReturnsPromise---### off---### on---### once---### play▸ **play**(params): Promise<[RoomSessionPlayback](./video-roomsessionplayback.md)\>Starts a playback in the room. You can use the returned [RoomSessionPlayback](./video-roomsessionplayback.md) object to control the playback (e.g., pause, resume, setVolume and stop).#### Parameters| Name | Type | Description || :--------------------- | :---------------------------------- | :------------------------------------------------------------------------------------------------------------------------------- || params | Object | - || params.url | string | The url (http, https, rtmp, rtmps) of the stream to reproduce. || params.volume? | number | The audio volume at which to play the stream. Values range from -50 to 50, with a default of 0. || params.seekPosition? | number | The starting timecode in milliseconds for playback. Defaults to 0. || params.positions? | [VideoPositions](#videopositions) | Positions to assign as soon as the playback starts. You can use the special keyword self to refer to the id of the playback. || params.layout? | string | Layout to change to when the playback starts. |#### ReturnsPromise<[RoomSessionPlayback](./video-roomsessionplayback.md)\>#### Permissions- room.playbackYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejavascriptconst playback = await roomSession.play({ url: rtmp://example.com/foo });await playback.stop();---### promote▸ **promote**(params): PromisePromotes a participant from audience to member. See [join](#join) and [demote](#demote).#### Parameters| Name | Type | Description || :----------------------- | :------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- || params | Object | - || params.memberId | string | Id of the audience participant to promote. || params.joinAudioMuted? | boolean | Force the members audio to be muted right after the promotion. || params.joinVideoMuted? | boolean | Force the members video to be muted right after the promotion. || params.mediaAllowed? | all \| audio-only \| video-only | Specifies the media that the client will be allowed to _send_. A member participant can always receive all media. || params.meta? | [Record][record-type] | Metadata to assign to the member. || params.permissions? | string[] | List of [permissions][permissions] to grant when the Audience participant will become a Member. |#### ReturnsPromise#### Permissions- room.member.promoteYou need to specify the permissions when [creating the Video Room Token](https://developer.signalwire.com/apis/reference/create_room_token) on the server side.#### Examplejavascriptawait roomSession.promote({ memberId: de550c0c-3fac-4efd-b06f-b5b8614b8966, mediaAllowed: all, permissions: [ room.self.audio_mute, room.self.audio_unmute, room.self.video_mute, room.self.video_unmute, room.list_available_layouts, ],});---### removeAllListeners---### removeAllMembers▸ **removeAllMembers**(): PromiseRemoves all the members from this room session. The room session will end.#### ReturnsPromise#### Permissions- room.member.remove: to remove a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Exampletypescriptawait roomSession.removeAllMembers();---### removeMember▸ **removeMember**(params): PromiseRemoves a specific participant from the room.#### Parameters| Name | Type | Description || :---------------- | :------- | :-------------------------- || params | Object | - || params.memberId | string | Id of the member to remove. |#### ReturnsPromise#### Permissions- room.member.remove: to remove a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejavascriptconst id = de550c0c-3fac-4efd-b06f-b5b8614b8966; // you can get this from getMembers()await roomSession.removeMember({ memberId: id });---### setHideVideoMuted▸ **setHideVideoMuted**(value): PromiseShow or hide muted videos in the room layout. Members that have been muted via [videoMute](./video-roomsession.mdx#videomute) will not appear in the video stream, instead of appearing as a mute image, if this setting is enabled.Muted videos are shown by default.#### Parameters| Name | Type | Description || :------ | :-------- | :----------------------------------------------- || value | boolean | Whether to hide muted videos in the room layout. |#### ReturnsPromise#### Permissions- room.hide_video_muted- room.show_video_mutedYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejavascriptawait roomSession.setHideVideoMuted(false);---### setInputSensitivity▸ **setInputSensitivity**(params): PromiseSets the input level at which the participant is identified as currently speaking. You can use this method to set the input sensitivity for either yourself or another participant in the room.#### Parameters| Name | Type | Description || :----------------- | :------- | :------------------------------------------------------------------------------------------------------------------------ || params | Object | - || params.memberId? | string | Id of the member to affect. If omitted, affects the default device in the local client. || params.value | number | Desired sensitivity from 0 (lowest sensitivity, essentially muted) to 100 (highest sensitivity). The default value is 30. |#### ReturnsPromise#### Permissions- room.self.set_input_sensitivity: to set the sensitivity for a local device.- room.member.set_input_sensitivity: to set the sensitivity for a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesSetting your own input sensitivity:javascriptawait roomSession.setInputSensitivity({ value: 80 });Setting the input sensitivity of another participant:javascriptconst id = de550c0c-3fac-4efd-b06f-b5b8614b8966; // you can get this from getMembers()await roomSession.setInputSensitivity({ memberId: id, value: 80 });---### setInputVolume▸ **setInputVolume**(params): PromiseSets the input volume level (e.g. for the microphone). You can use this method to set the input volume for either yourself or another participant in the room.#### Parameters| Name | Type | Description || :----------------- | :------- | :--------------------------------------------------------------------------------------------------------------------- || params | Object | - || params.memberId? | string | Id of the member for which to set input volume. If omitted, sets the volume of the default device in the local client. || params.volume | number | Desired volume. Values range from -50 to 50, with a default of 0. |#### ReturnsPromise#### Permissions- room.self.set_input_volume: to set the volume for a local device.- room.member.set_input_volume: to set the volume for a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesSetting your own microphone volume:javascriptawait roomSession.setInputVolume({ volume: -10 });Setting the microphone volume of another participant:javascriptconst id = de550c0c-3fac-4efd-b06f-b5b8614b8966; // you can get this from getMembers()await roomSession.setInputVolume({ memberId: id, volume: -10 });---### setLayout▸ **setLayout**(params): PromiseSets a layout for the room. You can obtain a list of available layouts with [getLayouts](./video-roomsession.mdx#getlayouts).#### Parameters| Name | Type | Description || :------------------ | :---------------------------------- | :---------------------------------------------------- || params | Object | - || params.name | string | Name of the layout. || params.positions? | [VideoPositions](#videopositions) | Positions to assign as soon as the new layout is set. |#### ReturnsPromise#### Permissions- room.set_layout- room.set_position (if you need to assign positions)You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExampleSet the 6x6 layout:javascriptawait roomSession.setLayout({ name: 6x6 });---### setLocalStream▸ **setLocalStream**(stream): voidReplaces the current local media stream with the one specified as a parameter.#### Parameters| Name | Type | Description || :------- | :---------------------------------------------------------------------------- | :----------------------- || stream | [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream) | The media stream to use. |#### Returnsvoid#### ExampleDrawing and streaming the picture of a face:javascriptconst canvas = document.createElement(canvas);const ctx = canvas.getContext(2d);// Set canvas sizecanvas.width = 400;canvas.height = 400;// Draw circlectx.beginPath();ctx.arc(200, 200, 150, 0, 2 * Math.PI);ctx.fillStyle = lightblue;ctx.fill();// Draw eyesctx.beginPath();ctx.arc(150, 150, 30, 0, 2 * Math.PI);ctx.arc(250, 150, 30, 0, 2 * Math.PI);ctx.fillStyle = black;ctx.fill();// Get the media streamconst stream = canvas.captureStream(25); // 25 FPS// Stream the canvasawait roomSession.setLocalStream(stream);---### setMemberMeta▸ **setMemberMeta**(params): PromiseAssigns custom metadata to the specified RoomSession member. You can use this to store metadata whose meaning is entirely defined by your application.Note that calling this method overwrites any metadata that had been previously set on the specified member.#### Parameters| Name | Type | Description || :----------------- | :-------------------------------------------- | :-------------------------------------------------------------------------------------- || params | Object | - || params.memberId? | string | Id of the member to affect. If omitted, affects the default device in the local client. || params.meta | [Record][record-type] | The medatada object to assign to the member. |#### ReturnsPromise#### Permissions- room.self.set_meta: to set the metadata for the local member.- room.member.set_meta: to set the metadata for a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesSetting metadata for the current member:jsawait roomSession.setMemberMeta({ meta: { email: joe@example.com, },});Setting metadata for another member:jsawait roomSession.setMemberMeta({ memberId: de550c0c-3fac-4efd-b06f-b5b8614b8966 // you can get this from getMembers() meta: { email: joe@example.com }})---### setMemberPosition▸ **setMemberPosition**(params): PromiseAssigns a position in the layout to the specified member.#### Parameters| Name | Type | Description || :----------------- | :-------------------------------- | :------------------------------------------------------------------ || params | Object | - || params.memberId? | string | Id of the member to affect. If omitted, affects the current member. || params.position | [VideoPosition](#videoposition) | Position to assign in the layout. |#### ReturnsPromise#### Permissions- room.self.set_position: to set the position for the local member.- room.member.set_position: to set the position for a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejsawait roomSession.setMemberPosition({ memberId: 1bf4d4fb-a3e4-4d46-80a8-3ebfdceb2a60, position: off-canvas,});---### setMeta▸ **setMeta**(meta): PromiseAssigns custom metadata to the RoomSession. You can use this to store metadata whose meaning is entirely defined by your application.Note that calling this method overwrites any metadata that had been previously set on this RoomSession.#### Parameters| Name | Type | Description || :----- | :-------------------------------------------- | :------------------------------------------------ || meta | [Record][record-type] | The medatada object to assign to the RoomSession. |#### ReturnsPromise#### Permissions- room.set_metaYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejsawait roomSession.setMeta({ foo: bar });---### setOutputVolume▸ **setOutputVolume**(params): PromiseSets the output volume level (e.g., for the speaker). You can use this method to set the output volume for either yourself or another participant in the room.#### Parameters| Name | Type | Description || :----------------- | :------- | :-------------------------------------------------------------------------------------- || params | Object | - || params.memberId? | string | Id of the member to affect. If omitted, affects the default device in the local client. || params.volume | number | Desired volume. Values range from -50 to 50, with a default of 0. |#### ReturnsPromise#### Permissions- room.self.set_output_volume: to set the speaker volume for yourself.- room.member.set_output_volume: to set the speaker volume for a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesSetting your own output volume:javascriptawait roomSession.setOutputVolume({ volume: -10 });Setting the output volume of another participant:javascriptconst id = de550c0c-3fac-4efd-b06f-b5b8614b8966; // you can get this from getMembers()await roomSession.setOutputVolume({ memberId: id, volume: -10 });---### setPositions▸ **setPositions**(params): PromiseAssigns a position in the layout for multiple members.#### Parameters| Name | Type | Description || :----------------- | :---------------------------------- | :--------------------------------------------- || params | Object | - || params.positions | [VideoPositions](#videopositions) | Mapping of member IDs and positions to assign. |#### ReturnsPromise#### Permissions- room.set_positionYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejsawait roomSession.setPositions({ positions: { 1bf4d4fb-a3e4-4d46-80a8-3ebfdceb2a60: reserved-1, e0c5be44-d6c7-438f-8cda-f859a1a0b1e7: auto, },});---### ~~showVideoMuted~~▸ **showVideoMuted**(): Promise> ⚠️ Deprecated.> Use [setHideVideoMuted](./video-roomsession.mdx#sethidevideomuted) instead.Show muted videos in the room layout in addition to the unmuted ones. Members that have been muted via [videoMute](./video-roomsession.mdx#videomute) will display a mute image instead of the video.#### ReturnsPromise#### Permissions- room.show_video_mutedYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejavascriptawait roomSession.showVideoMuted();---### startRecording▸ **startRecording**(): Promise<[RoomSessionRecording](./video-roomsessionrecording.md)\>Starts the recording of the room. You can use the returned [RoomSessionRecording](./video-roomsessionrecording.md) object to control the recording (e.g., pause, resume, stop).#### ReturnsPromise<[RoomSessionRecording](./video-roomsessionrecording.md)\>#### Permissions- room.recordingYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejavascriptconst rec = await roomSession.startRecording();await rec.stop();---### startScreenShare▸ **startScreenShare**(opts): Promise<[RoomSessionScreenShare](./video-roomsessionscreenshare.md)\>Adds a screen sharing instance to the room. You can create multiple screen sharing instances and add all of them to the room.#### Parameters| Name | Type | Description || :---------------- | :----------------------------------- | :----------------------------------------------------------------------------------- || opts | Object | - || opts.audio? | boolean \| MediaTrackConstraints | Audio constraints to use when joining the room. Default: false. || opts.autoJoin? | boolean | Whether the screen share object should automatically join the room. Default: true. || opts.layout? | string | Layout to switch to as soon as the screen share joins the room. || opts.positions? | [VideoPositions](#videopositions) | Layout positions to assign as soon as the screen share joins the room. || opts.video? | boolean \| MediaTrackConstraints | Video constraints to use when joining the room. Default: true. |#### ReturnsPromise<[RoomSessionScreenShare](./video-roomsessionscreenshare.md)\>#### Permissions- room.self.screenshareYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesSharing the screen together with the associated audio:jsawait roomSession.startScreenShare({ audio: true, video: true });Sharing the screen while changing layout:jsawait roomSession.startScreenShare({ audio: true, video: true, layout: screen-share, positions: { self: reserved-1, },});---### startStream▸ **startStream**(): Promise<[RoomSessionStream](./video-roomsessionstream.mdx)\>Starts streaming the audio/video of this room to an external service. You canuse the returned [RoomSessionStream](./video-roomsessionstream.mdx) object tointeract with the stream.#### Parameters| Name | Type | Description || :----------- | :------- | :--------------------------------------------------------------------------------------------- || params | Object | || params.url | string | RTMP or RTMPS url. This must be the address of a server accepting incoming RTMP/RTMPS streams. |#### ReturnsPromise<[RoomSessionStream](./video-roomsessionstream.mdx)\>#### Permissions- room.stream (or the more specific room.stream.start)You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### Examplejavascriptconst stream = await roomSession.startStream({ url: rtmp://example.com });// Stop the stream after 60 secondssetTimeout(() => stream.stop(), 60000);---### undeaf▸ **undeaf**(params?): PromiseUnmutes the incoming audio. The affected participant will start hearing audio from the other participants again. You can use this method to undeaf either yourself or another participant in the room.Note that in addition to allowing a participants to hear the others, this will also automatically unmute the microphone of the target participant (even if there is no audio_unmute permission). If you want, you can then manually mute it by calling [audioMute](./video-roomsession.mdx#audiomute).#### Parameters| Name | Type | Description || :----------------- | :------- | :-------------------------------------------------------------------------------------- || params? | Object | || params.memberId? | string | Id of the member to affect. If omitted, affects the default device in the local client. |#### ReturnsPromise#### Permissions- room.self.deaf: to make yourself deaf.- room.member.deaf: to make deaf a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesUndeaf yourself:javascriptawait roomSession.undeaf();Undeaf another participant:javascriptconst id = de550c0c-3fac-4efd-b06f-b5b8614b8966; // you can get this from getMembers()await roomSession.undeaf({ memberId: id });---### updateCamera▸ **updateCamera**(constraints): PromiseReplaces the current camera stream with the one coming from a different device.#### Parameters| Name | Type | Description || :------------ | :---------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- || constraints | MediaTrackConstraints | Specify the constraints that the device should satisfy. See [MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints). |#### ReturnsPromise#### ExampleReplaces the current camera stream with the one coming from the specified deviceId:javascriptawait roomSession.updateCamera({ deviceId: /o4ZeWzroh+8q0Ds/CFfmn9XpqaHzmW3L/5ZBC22CRg=,});---### updateMemberMeta▸ **updateMemberMeta**(params): PromiseUpdates a members metadata in only the specified fields. This is different from[setMemberMeta](#setmembermeta), which replaces the whole metadata object.#### Parameters| Name | Type | Description || :----------------- | :-------------------------------------------- | :------------------------------------------------------------------ || params | Object | - || params.memberId? | string | Id of the member to affect. If omitted, affects the current member. || params.meta | [Record][record-type] | The update to the metadata. |#### ReturnsPromise#### Permissions- room.set_metaYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplejsroomSession.on(member.updated, (e) => { // We can set an event listener to log changes to the metadata. console.log(e.member.meta);});await roomSession.setMemberMeta({ memberId: ..., meta: { foo: bar, baz: true },});// The logger will now print { foo: bar, baz: true }await roomSession.updateMemberMeta({ memberId: ..., meta: { baz: false, t: 10 },});// The logger will now print { foo: bar, baz: false, t: 10 }---### updateMeta▸ **updateMeta**(meta): PromiseUpdates the RoomSession metadata by only setting the specified fields. This isdifferent from [setMeta](#setmeta), which replaces the whole metadata object.#### Parameters| Name | Type | Description || :----- | :-------------------------------------------- | :-------------------------- || meta | [Record][record-type] | The update to the metadata. |#### ReturnsPromise#### Permissions- room.set_metaYou need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplejsroomSession.on(room.updated, (e) => { // We can set an event listener to log changes to the metadata. console.log(e.room.meta);});await roomSession.setMeta({ foo: bar, baz: true });// The logger will now print { foo: bar, baz: true }await roomSession.updateMeta({ baz: false, t: 10 });// The logger will now print { foo: bar, baz: false, t: 10 }---### updateMicrophone▸ **updateMicrophone**(constraints): PromiseReplaces the current microphone stream with the one coming from a different device.#### Parameters| Name | Type | Description || :------------ | :---------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- || constraints | MediaTrackConstraints | Specify the constraints that the device should satisfy. See [MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints). |#### ReturnsPromise#### ExampleReplaces the current microphone stream with the one coming from the specified deviceId:javascriptawait roomSession.updateMicrophone({ deviceId: /o4ZeWzroh+8q0Ds/CFfmn9XpqaHzmW3L/5ZBC22CRg=,});---### updateSpeaker▸ **updateSpeaker**(opts): PromiseReplaces the current speaker with a different one.> 📘> Some browsers do not support output device selection. You can check by calling [WebRTC.supportsMediaOutput](../webrtc/#supportsmediaoutput).#### Parameters| Name | Type | Description || :-------------- | :------- | :---------------------------- || opts | Object | || opts.deviceId | string | Id of the new speaker device. |#### ReturnsPromise#### ExampleReplaces the current speaker:javascriptawait roomSession.updateSpeaker({ deviceId: /o4ZeWzroh+8q0Ds/CFfmn9XpqaHzmW3L/5ZBC22CRg=,});---### videoMute▸ **videoMute**(params?): PromisePuts the video on mute. Participants will see a mute image instead of the video stream. You can use this method to mute either yourself or another participant in the room.#### Parameters| Name | Type | Description || :----------------- | :------- | :---------------------------------------------------------------------------------- || params? | Object | - || params.memberId? | string | Id of the member to mute. If omitted, mutes the default device in the local client. |#### ReturnsPromise#### Permissions- room.self.video_mute: to unmute a local device.- room.member.video_mute: to unmute a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesMuting your own video:javascriptawait roomSession.videoMute();Muting the video of another participant:javascriptconst id = de550c0c-3fac-4efd-b06f-b5b8614b8966; // you can get this from getMembers()await roomSession.videoMute({ memberId: id });---### videoUnmute▸ **videoUnmute**(params?): PromiseUnmutes the video if it had been previously muted. Participants will start seeing the video stream again. You can use this method to unmute either yourself or another participant in the room.#### Parameters| Name | Type | Description || :----------------- | :------- | :-------------------------------------------------------------------------------------- || params? | Object | - || params.memberId? | string | Id of the member to unmute. If omitted, unmutes the default device in the local client. |#### ReturnsPromise#### Permissions- room.self.video_mute: to unmute a local device.- room.member.video_mute: to unmute a remote member.You need to specify the permissions when [creating the Video Room Token](pathname:///rest/generate-a-new-video-room-token) on the server side.#### ExamplesUnmuting your own video:javascriptawait roomSession.videoUnmute();Unmuting the video of another participant:javascriptconst id = de550c0c-3fac-4efd-b06f-b5b8614b8966; // you can get this from getMembers()await roomSession.videoUnmute({ memberId: id });---## EventsList of events emitted by a RoomSession object.### camera.disconnected• **camera.disconnected**(e)A camera device was disconnected.#### Parameters| Name | Type | Description || :----------- | :------- | :---------------------------------------------- || e | object | - || e.label | string | Label for the camera that was disconnected. || e.deviceId | string | Device Id for the camera that was disconnected. |---### camera.updated• **camera.updated**(e)A camera device was updated.#### Parameters| Name | Type | Description || :-------------------- | :------- | :--------------------------------------------------- || e | object | - || e.current | object | Incoming information on the camera that was updated. || e.current.label | string | Current label for the camera. || e.current.deviceId | string | Current device Id for the camera. || e.previous | object | Previous information on the camera that was updated. || e.previous.label | string | Previous label for the camera. || e.previous.deviceId | string | Previous device Id for the camera. |---### layout.changed• **layout.changed**(e)The layout of the room has changed. This event is not limited to changesassociated to the grid layout of the room: it also includes for example changesin the position of the participants within the grid of the room.#### Parameters| Name | Type | Description || :------------------------- | :---------------------------------------- | :-------------------------------------------------------------------- || e | Object | - || e.room_session_id | string | Id of the room session. || e.room_id | string | Id of the room. || e.layout | Object | Information on the current layout. || e.layout.name | string | Name of the current layout. || e.layout.room_session_id | string | Id of the room session. || e.layout.room_id | string | Id of the room. || e.layout.layers | [VideoLayoutLayer](#videolayoutlayer)[] | Array containing information on all the layers in the current layout. |---### media.connected• **media.connected**New media has been connected. There is no payload, as this event is used to troubleshoot advanced use cases when hooking into the media connection.### media.disconnected• **media.disconnected**Media has been disconnected from the session. There is no payload, as this event is used to troubleshoot advanced use cases when hooking into the media connection.### media.reconnecting• **media.reconnecting**Media is attempting to reconnect to the session. There is no payload, as this event is used to troubleshoot advanced use cases when hooking into the media connection.### member.demoted• **member.demoted**(e)A member has been demoted to audience, for example using [demote](#demote).This event is only received by the client which gets demoted, but you shouldalways check if the member_id parameter corresponds to the current participantto ensure future compatibility.#### Parameters| Name | Type | Description || :------------------ | :------- | :---------------------------------- || e | Object | - || e.room_session_id | string | Id of the room session. || e.room_id | string | Id of the room. || e.member_id | string | Id of the member that was demoted. || e.authorization | Object | Information about the room context. |---### member.joined• **member.joined**(e)A member has joined the room.#### Parameters| Name | Type | Description || :--------------------------- | :-------- | :------------------------------------------------------------- || e | Object | - || e.room_session_id | string | Id of the room session. || e.room_id | string | Id of the room. || e.member | Object | Information about the member that joined. || e.member.visible | boolean | Whether the member is visible on the canvas. || e.member.room_session_id | string | Id of the room session member is joining. || e.member.input_volume | number | Volume for the members microphone. || e.member.id | string | Id of the joining member. || e.member.scope_id | string | Id identifying the members allowed scopes. || e.member.input_sensitivity | number | Level at which the member is identified as currently speaking. || e.member.output_volume | number | Volume for the members speaker. || e.member.audio_muted | boolean | Whether the members microphone is muted. || e.member.name | string | Friendly name for the member. || e.member.deaf | boolean | Whether the members speaker is muted. || e.member.video_muted | boolean | Whether the members camera is muted. || e.member.room_id | string | Id of the room member is joining. || e.member.type | string | The member type, either audience or member. |---### member.left• **member.left**(e)A member has left the room.#### Parameters| Name | Type | Description || :------------------------- | :------- | :---------------------------------------------- || e | Object | - || e.room_session_id | string | Id of the room session. || e.room_id | string | Id of the room. || e.member | Object | Information about the member that left. || e.member.room_session_id | string | Id of the room session that the member left. || e.member.id | string | Id of the leaving member. || e.member.room_id | string | Id of the room that the member left. || e.member.type | string | The member type, either audience or member. |---### member.promoted• **member.promoted**(e)An audience participant has been promoted to member, for example using [promote](#promote).This event is only received by the client which gets promoted, but you shouldalways check if the member_id parameter corresponds to the current participantto ensure future compatibility.#### Parameters| Name | Type | Description || :------------------ | :------- | :------------------------------------------- || e | Object | - || e.room_session_id | string | Id of the room session. || e.room_id | string | Id of the room. || e.member_id | string | Id of the audience member that was promoted. || e.authorization | Object | Information about the room context. |---### member.talking• **member.talking**(e)A member is talking or has stopped talking.#### Parameters| Name | Type | Description || :------------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------ || e | Object | - || e.room_session_id | string | Id of the room session. || e.room_id | string | Id of the room. || e.member | Object | Information about the member talking. || e.member.room_session_id | string | Id of the room session. || e.member.id | string | Id of the talking member. || e.member.room_id | string | Id of the room. || e.member.talking | boolean | Whether the member is speaking. A true value indicates the member has started speaking, while a false value indicates the member has stopped. |---### member.updated• **member.updated**(e)A property of a member of the room has been updated.#### Parameters| Name | Type | Description || :------------------------- | :--------- | :----------------------------------------------------- || e | object | - || e.room_session_id | string | Id for the room session that the updated member is in. || e.room_id | string | Id for the room that the updated member is in. || e.member | object | Information on the member that was updated. || e.member.updated | string[] | Which room properties were updated. || e.member.id | string | Id for the member that was updated. || e.member.room_session_id | string | Id for the room session that the updated member is in. || e.member.room_id | string | Id for the room that the updated member is in. || e.member.type | string | The member type, either audience or member. |In the field member.updated you find an array of all the properties that have been updated. The new values for those properties are available as additional fields of member.For example, say visible and video_muted have been updated. The received object will be:javascript{ room_session_id: 35e85417-09cf-4b07-8f21-d3c16809e5a8, room_id: aae25822-892c-4832-b0b3-34aac3a0e8d1, member: { updated: [visible, video_muted], room_session_id: 35e85417-09cf-4b07-8f21-d3c16809e5a8, visible: false, video_muted: true, id: 4a829c9f-812c-49d7-b272-e3077213c55e, room_id: aae25822-892c-4832-b0b3-34aac3a0e8d1, type: member }}---### memberList.updated• **memberList.updated**(e)The set of members or one or more properties of a member have changed.#### Parameters| Name | Type | Description || :---------- | :--------- | :----------------------------------------------------------------------------------------------------------------------------------- || e | object | - || e.members | object[] | A list of current members with the current values of their updatable properties as listed in the [getMembers](#getmembers) method. |---### microphone.disconnected• **microphone.disconnected**(e)A microphone device was disconnected.#### Parameters| Name | Type | Description || :----------- | :------- | :-------------------------------------------------- || e | object | - || e.label | string | Label for the microphone that was disconnected. || e.deviceId | string | Device Id for the microphone that was disconnected. |---### microphone.updated• **microphone.updated**(e)A microphone device was updated.#### Parameters| Name | Type | Description || :-------------------- | :------- | :------------------------------------------------------- || e | object | - || e.current | object | Incoming information on the microphone that was updated. || e.current.label | string | Current label for the microphone. || e.current.deviceId | string | Current device Id for the microphone. || e.previous | object | Previous information on the microphone that was updated. || e.previous.label | string | Previous label for the microphone. || e.previous.deviceId | string | Previous device Id for the microphone. |---### playback.ended• **playback.ended**A playback has ended. You only receive this event if your token has the room.playback permission. The event handler receives a [RoomSessionPlayback](./video-roomsessionplayback.md) object.---### playback.started• **playback.started**A playback has been started. You only receive this event if your token has the room.playback permission. The event handler receives a [RoomSessionPlayback](./video-roomsessionplayback.md) object.---### playback.updated• **playback.updated**A playback has been updated. You only receive this event if your token has the room.playback permission. The event handler receives a [RoomSessionPlayback](./video-roomsessionplayback.md) object.---### recording.ended• **recording.ended**An active recording has been stopped. You only receive this event if your token has the room.recording permission. The event handler receives a [RoomSessionRecording](./video-roomsessionrecording.md) object.---### recording.started• **recording.started**A recording has been started in the room. You only receive this event if your token has the room.recording permission. The event handler receives a [RoomSessionRecording](./video-roomsessionrecording.md) object.---### recording.updated• **recording.updated**An active recording has been updated. You only receive this event if your token has the room.recording permission. The event handler receives a [RoomSessionRecording](./video-roomsessionrecording.md) object.---### room.audience_count• **room.audience_count**(e)This event is received periodically, and contains a total count of audience members.Audience members joining and leaving trigger this event.#### Parameters| Name | Type | Description || :------------------ | :------- | :-------------------------------- || e | Object | - || e.room_session_id | string | Id of the room session. || e.room_id | string | Id of the room. || e.total | number | Total number of audience members. |---### room.joined• **room.joined**(e)The current client joined the room session. The event handler receives objects that contain information about the room and all its members (including the current client).#### Parameters| Name | Type | Description || :-------------------------------- | :--------- | :----------------------------------------------------------------------------------------------------------------------------------- || e | Object | - || e.call_id | string | Low level call identifier for the video room connection. || e.member_id | string | Id for the current client member. || e.room_session | object | Information about the room session that has been joined. || e.room_session.room_session_id | string | Id for the current room session. || e.room_session.logos_visible | boolean | Whether logos are visible in participant name banners. || e.room_session.members | object[] | A list of current members with the current values of their updatable properties as listed in the [getMembers](#getmembers) method. || e.room_session.blind_mode | boolean | Whether participants are allowed to turn off their camera. || e.room_session.recording | boolean | Whether recording is active in the session. || e.room_session.silent_mode | boolean | Whether participants are allowed to turn off their microphone. || e.room_session.name | string | Friendly name of the room session. || e.room_session.hide_video_muted | boolean | Whether participants with their cameras off are shown on the canvas. || e.room_session.locked | boolean | Whether additional participants can join the room session. || e.room_session.meeting_mode | boolean | Whether event feedback sounds (such as beeps when participants join or leave) are disabled in the session. || e.room_session.room_id | string | Id for the current room. || e.room_session.event_channel | string | Id for the event channel on which these room sessions events are reported. || e.room_session.layout_name | string | Name of the current canvas layout. |---### room.left• **room.left**(e)The current client left the room session.#### Parameters| Name | Type | Description || :--------- | :------- | :-------------------------------------------------------------------------------------------------- || e | Object | - || e.reason | string | Reason client left the session. Possible values are RECONNECTION_ATTEMPT_TIMEOUT and undefined. |---### room.updated• **room.updated**(e)The properties of the room have been updated.#### Parameters| Name | Type | Description || :----------------------- | :--------- | :---------------------------------------- || e | object | - || e.room_session_id | string | Id for the room session that was updated. || e.room_id | string | Id for the room that was updated. || e.room | object | Information on the room that was updated. || e.room.updated | string[] | Which room properties were updated. || e.room.room_session_id | string | Id for the room session that was updated. || e.room.room_id | string | Id for the room that was updated. |In the field room.updated you find an array of all the properties that have been updated. The new values for those properties are available as additional fields of room.For example, if hide_video_muted has been updated, the received object will be:javascript{ room_session_id: fc695445-7f93-4597-b705-c0db6c21096a, room_id: aae25822-892c-4832-b0b3-34aac3a0e8d1, room: { updated: [ hide_video_muted ], room_session_id: fc695445-7f93-4597-b705-c0db6c21096a, room_id: aae25822-892c-4832-b0b3-34aac3a0e8d1, hide_video_muted: true }}---### speaker.disconnected• **speaker.disconnected**(e)A speaker device was disconnected.#### Parameters| Name | Type | Description || :----------- | :------- | :----------------------------------------------- || e | object | - || e.label | string | Label for the speaker that was disconnected. || e.deviceId | string | Device Id for the speaker that was disconnected. |---### speaker.updated• **speaker.updated**(e)A speaker device was updated.#### Parameters| Name | Type | Description || :-------------------- | :------- | :---------------------------------------------------- || e | object | - || e.current | object | Incoming information on the speaker that was updated. || e.current.label | string | Current label for the speaker. || e.current.deviceId | string | Current device Id for the speaker. || e.previous | object | Previous information on the speaker that was updated. || e.previous.label | string | Previous label for the speaker. || e.previous.deviceId | string | Previous device Id for the speaker. |---### stream.ended• **stream.ended**(stream)A stream ended (e.g., it was stopped).#### Parameters| Name | Type || :------- | :--------------------------------------------------- || stream | [RoomSessionStream](./video-roomsessionstream.mdx) |---### stream.started• **stream.started**(stream)A new stream started.#### Parameters| Name | Type || :------- | :--------------------------------------------------- || stream | [RoomSessionStream](./video-roomsessionstream.mdx) |## Type Aliases### VideoLayoutLayerƬ **VideoLayoutLayer**: ObjectAn object that represents a layer in a video layout. It contains the following keys.| Name | Type | Description || :------------- | :-------------------------------- | :--------------------------------------------- || member_id? | string | Id of the member in this layer, if any. || y | number | Y position of this layer. || x | number | X position of this layer. || height | number | Height of this layer. || width | number | Width of this layer. || layer_index | number | Index of this layer. || z_index | number | Z order of this layer. || reservation | string | Reservation name for this layer. || position | [VideoPosition](#videoposition) | Video position associated to this layer. || playing_file | boolean | Whether there is a file playing in this layer. || visible | boolean | Whether this layer is visible. |---### VideoPositionƬ **VideoPosition**: auto \| reserved-${number} \| standard-${number} \| off-canvasEach video layout has a number of positions which members can be assigned to. This type enumerates all the available position names. Note that not all these position names may be available within a given layout.- auto: the position of the member in the layout is determined automatically.- reserved-n: the _n_-th reserved position in the layout (e.g. reserved-3).- standard-n: the _n_-th standard position in the layout (e.g. standard-3).- off-canvas: the member is hidden outside the layout.---### VideoPositionsƬ **VideoPositions**: [Record][record-type]An object whose keys represent member IDs, and values are chosen from [VideoPosition](#videoposition). Instead of a member ID, in some contexts you can use the special keyword self if you dont know yet the ID of the member which is going to be created.For example:js{ 1bf4d4fb-a3e4-4d46-80a8-3ebfdceb2a60: reserved-1, e0c5be44-d6c7-438f-8cda-f859a1a0b1e7: auto}Or:js{ self: reserved-1}[record-type]: https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type[media-stream-constraints]: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia[permissions]: pathname:///rest/overview/permissions/