diff --git a/packages/react-native-hms/src/classes/HMSUpdateListenerActions.ts b/packages/react-native-hms/src/classes/HMSUpdateListenerActions.ts index bed42bf72..b09fef906 100644 --- a/packages/react-native-hms/src/classes/HMSUpdateListenerActions.ts +++ b/packages/react-native-hms/src/classes/HMSUpdateListenerActions.ts @@ -9,6 +9,14 @@ * * @enum {string} * + * @example + * ```typescript + * hmsInstance.addEventListener(HMSUpdateListenerActions.ON_JOIN, ({ room: HMSRoom }}) => { + * console.log('Joined room', data); + * // Handle the event + * }); + * ``` + * * @property {string} ON_PREVIEW - Emitted when the local preview is available. * @property {string} ON_JOIN - Emitted when the local user joins the room. * @property {string} ON_ROOM_UPDATE - Emitted when there is an update related to the room. @@ -85,6 +93,18 @@ export enum HMSUpdateListenerActions { */ ON_PEER_UPDATE = '3', + /** + * Event emitted when the list of peers in the room is updated. + * + * This event is triggered whenever there is a change in the list of peers present in the room, such as when a new peer joins, + * an existing peer leaves. It allows the application to react to changes in the room's + * participant list, enabling dynamic updates to the UI or other logic based on the current set of participants. + * + * @type {string} + * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/large-room + */ + ON_PEER_LIST_UPDATED = 'ON_PEER_LIST_UPDATED', + /** * Event emitted when there is an update related to a track in the room. * @@ -260,7 +280,7 @@ export enum HMSUpdateListenerActions { ON_REMOTE_VIDEO_STATS = 'ON_REMOTE_VIDEO_STATS', /** - * Event emitted when the audio device has changed. + * Event emitted when the audio device has changed. Android only. * * This event is triggered whenever there is a change in the audio output device, such as switching from the built-in speaker to a Bluetooth headset. * Handling this event allows the application to update any UI elements or settings related to the current audio device, ensuring that the user is always aware of which device is being used for audio output. @@ -294,18 +314,6 @@ export enum HMSUpdateListenerActions { */ ON_SESSION_STORE_CHANGED = 'ON_SESSION_STORE_CHANGED', - /** - * Event emitted when the list of peers in the room is updated. - * - * This event is triggered whenever there is a change in the list of peers present in the room, such as when a new peer joins, - * an existing peer leaves, or a peer's properties are updated. It allows the application to react to changes in the room's - * participant list, enabling dynamic updates to the UI or other logic based on the current set of participants. - * - * @type {string} - * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/large-room - */ - ON_PEER_LIST_UPDATED = 'ON_PEER_LIST_UPDATED', - /** * Event emitted when transcripts are available. *