Skip to content

Commit

Permalink
fix: disable on permission denied
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 committed Feb 3, 2025
1 parent af44914 commit 529d023
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
});
};

Expand All @@ -331,6 +334,7 @@ export class HMSLocalAudioTrack extends HMSAudioTrack {
reason,
}),
);
this.eventBus.localAudioEnabled.publish({ enabled: false, track: this });
};

/** @internal */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
});
};

Expand Down

0 comments on commit 529d023

Please sign in to comment.