> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # Events The RoomSession object emits the events listed below. You can work with these events using the following methods: #### [on](/docs/browser-sdk/v3/js/reference/video/room-session/on) Subscribe to an event #### [once](/docs/browser-sdk/v3/js/reference/video/room-session/once) Subscribe to an event once #### [off](/docs/browser-sdk/v3/js/reference/video/room-session/off) Unsubscribe from an event #### [removeAllListeners](/docs/browser-sdk/v3/js/reference/video/room-session/remove-all-listeners) Remove all event listeners ## Events ### camera.disconnected * **camera.disconnected**(`event`) A camera device was disconnected. #### Properties **`event`** `object` Event object --- **`event.label`** `string` Label for the camera that was disconnected. --- **`event.deviceId`** `string` Device Id for the camera that was disconnected. --- ### camera.updated * **camera.updated**(`event`) A camera device was updated. #### Properties **`event`** `object` Event object --- **`event.current`** `object` Incoming information on the camera that was updated. --- **`event.current.label`** `string` Current label for the camera. --- **`event.current.deviceId`** `string` Current device Id for the camera. --- **`event.previous`** `object` Previous information on the camera that was updated. --- **`event.previous.label`** `string` Previous label for the camera. --- **`event.previous.deviceId`** `string` Previous device Id for the camera. --- ### layout.changed * **layout.changed**(`event`) The layout of the room has changed. This event is not limited to changes associated to the grid layout of the room: it also includes for example changes in the position of the participants within the grid of the room. #### Properties **`event`** `object` Event object --- **`event.room_session_id`** `string` Id of the room session. --- **`event.room_id`** `string` Id of the room. --- **`event.layout`** `object` Information on the current layout. --- **`event.layout.name`** `string` Name of the current layout. --- **`event.layout.room_session_id`** `string` Id of the room session. --- **`event.layout.room_id`** `string` Id of the room. --- **`event.layout.layers`** `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**(`event`) 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 should always check if the `member_id` parameter corresponds to the current participant to ensure future compatibility. #### Properties **`event`** `object` Event object --- **`event.room_session_id`** `string` Id of the room session. --- **`event.room_id`** `string` Id of the room. --- **`event.member_id`** `string` Id of the member that was demoted. --- **`event.authorization`** `object` Information about the room context. --- ### member.joined * **member.joined**(`event`) A member has joined the room. #### Properties **`event`** `object` Event object --- **`event.room_session_id`** `string` Id of the room session. --- **`event.room_id`** `string` Id of the room. --- **`event.member`** `object` Information about the member that joined. --- **`event.member.visible`** `boolean` Whether the member is visible on the canvas. --- **`event.member.room_session_id`** `string` Id of the room session member is joining. --- **`event.member.input_volume`** `number` Volume for the member's microphone. --- **`event.member.id`** `string` Id of the joining member. --- **`event.member.scope_id`** `string` Id identifying the member's allowed scopes. --- **`event.member.input_sensitivity`** `number` Level at which the member is identified as currently speaking. --- **`event.member.output_volume`** `number` Volume for the member's speaker. --- **`event.member.audio_muted`** `boolean` Whether the member's microphone is muted. --- **`event.member.name`** `string` Friendly name for the member. --- **`event.member.deaf`** `boolean` Whether the member's speaker is muted. --- **`event.member.video_muted`** `boolean` Whether the member's camera is muted. --- **`event.member.room_id`** `string` Id of the room member is joining. --- **`event.member.type`** `string` The member type, either `audience` or `member`. --- ### member.left * **member.left**(`event`) A member has left the room. #### Properties **`event`** `object` Event object --- **`event.room_session_id`** `string` Id of the room session. --- **`event.room_id`** `string` Id of the room. --- **`event.member`** `object` Information about the member that left. --- **`event.member.room_session_id`** `string` Id of the room session that the member left. --- **`event.member.id`** `string` Id of the leaving member. --- **`event.member.room_id`** `string` Id of the room that the member left. --- **`event.member.type`** `string` The member type, either `audience` or `member`. --- ### member.promoted * **member.promoted**(`event`) 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 should always check if the `member_id` parameter corresponds to the current participant to ensure future compatibility. #### Properties **`event`** `object` Event object --- **`event.room_session_id`** `string` Id of the room session. --- **`event.room_id`** `string` Id of the room. --- **`event.member_id`** `string` Id of the audience member that was promoted. --- **`event.authorization`** `object` Information about the room context. --- ### member.talking * **member.talking**(`event`) A member is talking or has stopped talking. #### Properties **`event`** `object` Event object --- **`event.room_session_id`** `string` Id of the room session. --- **`event.room_id`** `string` Id of the room. --- **`event.member`** `object` Information about the member talking. --- **`event.member.room_session_id`** `string` Id of the room session. --- **`event.member.id`** `string` Id of the talking member. --- **`event.member.room_id`** `string` Id of the room. --- **`event.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**(`event`) A property of a member of the room has been updated. #### Properties **`event`** `object` Event object --- **`event.room_session_id`** `string` Id for the room session that the updated member is in. --- **`event.room_id`** `string` Id for the room that the updated member is in. --- **`event.member`** `object` Information on the member that was updated. --- **`event.member.updated`** `string[]` Which room properties were updated. --- **`event.member.id`** `string` Id for the member that was updated. --- **`event.member.room_session_id`** `string` Id for the room session that the updated member is in. --- **`event.member.room_id`** `string` Id for the room that the updated member is in. --- **`event.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**(`event`) The set of members or one or more properties of a member have changed. #### Properties **`event`** `object` Event object --- **`event.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**(`event`) A microphone device was disconnected. #### Properties **`event`** `object` Event object --- **`event.label`** `string` Label for the microphone that was disconnected. --- **`event.deviceId`** `string` Device Id for the microphone that was disconnected. --- ### microphone.updated * **microphone.updated**(`event`) A microphone device was updated. #### Properties **`event`** `object` Event object --- **`event.current`** `object` Incoming information on the microphone that was updated. --- **`event.current.label`** `string` Current label for the microphone. --- **`event.current.deviceId`** `string` Current device Id for the microphone. --- **`event.previous`** `object` Previous information on the microphone that was updated. --- **`event.previous.label`** `string` Previous label for the microphone. --- **`event.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](/docs/browser-sdk/v3/js/reference/video/room-session-playback) 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](/docs/browser-sdk/v3/js/reference/video/room-session-playback) 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](/docs/browser-sdk/v3/js/reference/video/room-session-playback) 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](/docs/browser-sdk/v3/js/reference/video/room-session-recording) 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](/docs/browser-sdk/v3/js/reference/video/room-session-recording) 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](/docs/browser-sdk/v3/js/reference/video/room-session-recording) object. --- ### room.audience\_count * **room.audience\_count**(`event`) This event is received periodically, and contains a total count of audience members. Audience members joining and leaving trigger this event. #### Properties **`event`** `object` Event object --- **`event.room_session_id`** `string` Id of the room session. --- **`event.room_id`** `string` Id of the room. --- **`event.total`** `number` Total number of audience members. --- ### room.joined * **room.joined**(`event`) 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). #### Properties **`event`** `object` Event object --- **`event.call_id`** `string` Low level call identifier for the video room connection. --- **`event.member_id`** `string` Id for the current client member. --- **`event.room_session`** `object` Information about the room session that has been joined. --- **`event.room_session.room_session_id`** `string` Id for the current room session. --- **`event.room_session.logos_visible`** `boolean` Whether logos are visible in participant name banners. --- **`event.room_session.members`** `object[]` A list of current members with the current values of their updatable properties as listed in the [`getMembers`](#getmembers) method. --- **`event.room_session.blind_mode`** `boolean` Whether participants are allowed to turn off their camera. --- **`event.room_session.recording`** `boolean` Whether recording is active in the session. --- **`event.room_session.silent_mode`** `boolean` Whether participants are allowed to turn off their microphone. --- **`event.room_session.name`** `string` Friendly name of the room session. --- **`event.room_session.hide_video_muted`** `boolean` Whether participants with their cameras off are shown on the canvas. --- **`event.room_session.locked`** `boolean` Whether additional participants can join the room session. --- **`event.room_session.meeting_mode`** `boolean` Whether event feedback sounds (such as beeps when participants join or leave) are disabled in the session. --- **`event.room_session.room_id`** `string` Id for the current room. --- **`event.room_session.event_channel`** `string` Id for the event channel on which these room session's events are reported. --- **`event.room_session.layout_name`** `string` Name of the current canvas layout. --- ### room.left * **room.left**(`event`) The current client left the room session. #### Properties **`event`** `object` Event object --- **`event.reason`** `string` Reason client left the session. Possible values are `RECONNECTION_ATTEMPT_TIMEOUT` and `undefined`. --- ### room.updated * **room.updated**(`event`) The properties of the room have been updated. #### Properties **`event`** `object` Event object --- **`event.room_session_id`** `string` Id for the room session that was updated. --- **`event.room_id`** `string` Id for the room that was updated. --- **`event.room`** `object` Information on the room that was updated. --- **`event.room.updated`** `string[]` Which room properties were updated. --- **`event.room.room_session_id`** `string` Id for the room session that was updated. --- **`event.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**(`event`) A speaker device was disconnected. #### Properties **`event`** `object` Event object --- **`event.label`** `string` Label for the speaker that was disconnected. --- **`event.deviceId`** `string` Device Id for the speaker that was disconnected. --- ### speaker.updated * **speaker.updated**(`event`) A speaker device was updated. #### Properties **`event`** `object` Event object --- **`event.current`** `object` Incoming information on the speaker that was updated. --- **`event.current.label`** `string` Current label for the speaker. --- **`event.current.deviceId`** `string` Current device Id for the speaker. --- **`event.previous`** `object` Previous information on the speaker that was updated. --- **`event.previous.label`** `string` Previous label for the speaker. --- **`event.previous.deviceId`** `string` Previous device Id for the speaker. --- ### stream.ended * **stream.ended**(`stream`) A stream ended (e.g., it was stopped). #### Properties **`stream`** `RoomSessionStream` The stream object. See [`RoomSessionStream`](/docs/browser-sdk/v3/js/reference/video/room-session-stream). --- ### stream.started * **stream.started**(`stream`) A new stream started. #### Properties **`stream`** `RoomSessionStream` The stream object. See [`RoomSessionStream`](/docs/browser-sdk/v3/js/reference/video/room-session-stream). ---