From ae07ed9445e1b75b5f7eaaa7b2cc3c01aff27dc2 Mon Sep 17 00:00:00 2001 From: Slowlife01 Date: Sun, 13 Apr 2025 15:00:04 +0700 Subject: [PATCH] fix(MediaController): prevent media control actions when 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 c77b38a75..968e8836f 100644 --- a/src/browser/base/zen-components/ZenMediaController.mjs +++ b/src/browser/base/zen-components/ZenMediaController.mjs @@ -95,6 +95,8 @@ this.mediaProgressBar.addEventListener('change', this.onMediaSeekComplete.bind(this)); window.addEventListener('TabSelect', (event) => { + if (this.isSharing) return; + const linkedBrowser = event.target.linkedBrowser; this.switchController(); @@ -279,7 +281,6 @@ } setupMediaControlUI(metadata, positionState) { - if (this.isSharing) return; this.updatePipButton(); if (!this.mediaControlBar.classList.contains('playing') && this._currentMediaController.isPlaying) { @@ -324,7 +325,7 @@ lastUpdated: Date.now(), }); - if (!this._currentBrowser) { + if (!this._currentBrowser && !this.isSharing) { this.setupMediaController(mediaController, browser); this.setupMediaControlUI(metadata, positionState); }