From ade64d84f5593419f601e851464e7042803c77d0 Mon Sep 17 00:00:00 2001 From: Yogesh Singh Date: Thu, 26 Sep 2024 15:26:27 +0530 Subject: [PATCH 1/2] fix: made native track mute status change reason generic instead of always incoming-call --- .../src/media/tracks/HMSLocalVideoTrack.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts b/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts index 5e5090ecd8..2d8579b1ce 100644 --- a/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts +++ b/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts @@ -522,11 +522,12 @@ export class HMSLocalVideoTrack extends HMSVideoTrack { } private handleTrackMute = () => { - HMSLogger.d(this.TAG, 'muted natively'); + HMSLogger.d(this.TAG, 'muted natively', document.visibilityState); + const reason = 'visibility-change'; this.eventBus.analytics.publish( this.sendInterruptionEvent({ started: true, - reason: 'incoming-call', + reason: reason, }), ); this.eventBus.localVideoEnabled.publish({ enabled: false, track: this }); @@ -534,11 +535,12 @@ export class HMSLocalVideoTrack extends HMSVideoTrack { /** @internal */ handleTrackUnmute = () => { - HMSLogger.d(this.TAG, 'unmuted natively'); + HMSLogger.d(this.TAG, 'unmuted natively', document.visibilityState); + const reason = 'visibility-change'; this.eventBus.analytics.publish( this.sendInterruptionEvent({ started: false, - reason: 'incoming-call', + reason: reason, }), ); super.handleTrackUnmute(); From 6a0a68af225b2514be9399110d65c5a1cc268644 Mon Sep 17 00:00:00 2001 From: Yogesh Singh Date: Thu, 26 Sep 2024 17:12:58 +0530 Subject: [PATCH 2/2] fix: updated reason string --- .../hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts b/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts index 2d8579b1ce..f05da3f17e 100644 --- a/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts +++ b/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts @@ -523,7 +523,7 @@ export class HMSLocalVideoTrack extends HMSVideoTrack { private handleTrackMute = () => { HMSLogger.d(this.TAG, 'muted natively', document.visibilityState); - const reason = 'visibility-change'; + const reason = document.visibilityState === 'hidden' ? 'visibility-change' : 'incoming-call'; this.eventBus.analytics.publish( this.sendInterruptionEvent({ started: true, @@ -536,7 +536,7 @@ export class HMSLocalVideoTrack extends HMSVideoTrack { /** @internal */ handleTrackUnmute = () => { HMSLogger.d(this.TAG, 'unmuted natively', document.visibilityState); - const reason = 'visibility-change'; + const reason = document.visibilityState === 'hidden' ? 'visibility-change' : 'incoming-call'; this.eventBus.analytics.publish( this.sendInterruptionEvent({ started: false,