From 3f8a6e04c89a47d2b9f3ad03cddc0870e7760f80 Mon Sep 17 00:00:00 2001 From: Slowlife01 Date: Tue, 15 Apr 2025 15:56:58 +0700 Subject: [PATCH] fix(MediaController): update share state from same tab if not sharing --- src/browser/base/zen-components/ZenMediaController.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/browser/base/zen-components/ZenMediaController.mjs b/src/browser/base/zen-components/ZenMediaController.mjs index 3d8e616de..bd193caa3 100644 --- a/src/browser/base/zen-components/ZenMediaController.mjs +++ b/src/browser/base/zen-components/ZenMediaController.mjs @@ -359,9 +359,10 @@ for (const browser of window.gBrowser.browsers) { const isMatch = browser.innerWindowID === windowId; const isCurrentBrowser = this._currentBrowser?.browserId === browser.browserId; + const shouldShow = showCameraIndicator || showMicrophoneIndicator; if (!isMatch) continue; - if (!isCurrentBrowser && (showCameraIndicator || showMicrophoneIndicator)) { + if (shouldShow && !(isCurrentBrowser && this.isSharing)) { const webRTC = browser.browsingContext.currentWindowGlobal.getActor('WebRTC'); webRTC.sendAsyncMessage('webrtc:UnmuteMicrophone'); webRTC.sendAsyncMessage('webrtc:UnmuteCamera'); @@ -373,7 +374,7 @@ this.activateMediaDeviceControls(browser) ); } else this.activateMediaDeviceControls(browser); - } else if (isCurrentBrowser && this.isSharing && !(showCameraIndicator || showMicrophoneIndicator)) { + } else if (!shouldShow && isCurrentBrowser && this.isSharing) { this.isSharing = false; this._currentBrowser = null; this.hideMediaControls();