diff --git a/packages/hms-video-web/src/notification-manager/HMSNotificationMethod.ts b/packages/hms-video-web/src/notification-manager/HMSNotificationMethod.ts index 5a5dad15d5..6ffeae050a 100644 --- a/packages/hms-video-web/src/notification-manager/HMSNotificationMethod.ts +++ b/packages/hms-video-web/src/notification-manager/HMSNotificationMethod.ts @@ -29,6 +29,7 @@ export enum HMSNotificationMethod { RTMP_STOP = 'on-rtmp-stop', RECORDING_START = 'on-record-start', RECORDING_STOP = 'on-record-stop', + HLS_INIT = 'on-hls-init', HLS_START = 'on-hls-start', HLS_STOP = 'on-hls-stop', METADATA_CHANGE = 'on-metadata-change', diff --git a/packages/hms-video-web/src/notification-manager/managers/RoomUpdateManager.ts b/packages/hms-video-web/src/notification-manager/managers/RoomUpdateManager.ts index 7db53caac6..4356a0d438 100644 --- a/packages/hms-video-web/src/notification-manager/managers/RoomUpdateManager.ts +++ b/packages/hms-video-web/src/notification-manager/managers/RoomUpdateManager.ts @@ -125,7 +125,11 @@ export class RoomUpdateManager { } private onHLS(method: string, notification: HLSNotification) { - if (![HMSNotificationMethod.HLS_START, HMSNotificationMethod.HLS_STOP].includes(method as HMSNotificationMethod)) { + if ( + ![HMSNotificationMethod.HLS_INIT, HMSNotificationMethod.HLS_START, HMSNotificationMethod.HLS_STOP].includes( + method as HMSNotificationMethod, + ) + ) { return; } const room = this.store.getRoom(); @@ -134,7 +138,9 @@ export class RoomUpdateManager { return; } - notification.enabled = method === HMSNotificationMethod.HLS_START && !notification.error?.code; + notification.enabled = + [HMSNotificationMethod.HLS_INIT, HMSNotificationMethod.HLS_START].includes(method as HMSNotificationMethod) && + !notification.error?.code; room.hls = this.convertHls(notification); room.recording.hls = this.getHLSRecording(notification); this.listener?.onRoomUpdate(HMSRoomUpdate.HLS_STREAMING_STATE_UPDATED, room);