fix(ZenMediaController): skip updaing share state when already showing

This commit is contained in:
Slowlife01 2025-04-14 00:55:52 +07:00
parent 3932ec21f5
commit 713e267c16

View file

@ -358,9 +358,10 @@
for (const browser of window.gBrowser.browsers) { for (const browser of window.gBrowser.browsers) {
const isMatch = browser.innerWindowID === windowId; const isMatch = browser.innerWindowID === windowId;
const isCurrentBrowser = this._currentBrowser?.browserId === browser.browserId;
if (!isMatch) continue; if (!isMatch) continue;
if (showCameraIndicator || showMicrophoneIndicator) { if (!isCurrentBrowser && (showCameraIndicator || showMicrophoneIndicator)) {
const webRTC = browser.browsingContext.currentWindowGlobal.getActor('WebRTC'); const webRTC = browser.browsingContext.currentWindowGlobal.getActor('WebRTC');
webRTC.sendAsyncMessage('webrtc:UnmuteMicrophone'); webRTC.sendAsyncMessage('webrtc:UnmuteMicrophone');
webRTC.sendAsyncMessage('webrtc:UnmuteCamera'); webRTC.sendAsyncMessage('webrtc:UnmuteCamera');
@ -372,7 +373,7 @@
this.activateMediaDeviceControls(browser) this.activateMediaDeviceControls(browser)
); );
} else this.activateMediaDeviceControls(browser); } else this.activateMediaDeviceControls(browser);
} else if (this.isSharing && !(showCameraIndicator || showMicrophoneIndicator)) { } else if (isCurrentBrowser && this.isSharing && !(showCameraIndicator || showMicrophoneIndicator)) {
this.isSharing = false; this.isSharing = false;
this._currentBrowser = null; this._currentBrowser = null;
this.hideMediaControls(); this.hideMediaControls();