diff --git a/packages/hms-video-store/src/media/tracks/HMSLocalAudioTrack.ts b/packages/hms-video-store/src/media/tracks/HMSLocalAudioTrack.ts index 84482be5e2..a0abd1f6be 100644 --- a/packages/hms-video-store/src/media/tracks/HMSLocalAudioTrack.ts +++ b/packages/hms-video-store/src/media/tracks/HMSLocalAudioTrack.ts @@ -319,6 +319,9 @@ export class HMSLocalAudioTrack extends HMSAudioTrack { private trackPermissions = () => { listenToPermissionChange('microphone', (state: PermissionState) => { this.eventBus.analytics.publish(AnalyticsEventFactory.permissionChange(this.type, state)); + if (state === 'denied') { + this.eventBus.localAudioEnabled.publish({ enabled: false, track: this }); + } }); }; @@ -331,6 +334,7 @@ export class HMSLocalAudioTrack extends HMSAudioTrack { reason, }), ); + this.eventBus.localAudioEnabled.publish({ enabled: false, track: this }); }; /** @internal */ diff --git a/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts b/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts index 4e5c2a864e..4b800c2bbf 100644 --- a/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts +++ b/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts @@ -530,6 +530,9 @@ export class HMSLocalVideoTrack extends HMSVideoTrack { private trackPermissions = () => { listenToPermissionChange('camera', (state: PermissionState) => { this.eventBus.analytics.publish(AnalyticsEventFactory.permissionChange(this.type, state)); + if (state === 'denied') { + this.eventBus.localVideoEnabled.publish({ enabled: false, track: this }); + } }); };