mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-07 02:16:36 +00:00
fix(MediaController): prevent media control actions when sharing
This commit is contained in:
@@ -95,6 +95,8 @@
|
|||||||
this.mediaProgressBar.addEventListener('change', this.onMediaSeekComplete.bind(this));
|
this.mediaProgressBar.addEventListener('change', this.onMediaSeekComplete.bind(this));
|
||||||
|
|
||||||
window.addEventListener('TabSelect', (event) => {
|
window.addEventListener('TabSelect', (event) => {
|
||||||
|
if (this.isSharing) return;
|
||||||
|
|
||||||
const linkedBrowser = event.target.linkedBrowser;
|
const linkedBrowser = event.target.linkedBrowser;
|
||||||
this.switchController();
|
this.switchController();
|
||||||
|
|
||||||
@@ -279,7 +281,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
setupMediaControlUI(metadata, positionState) {
|
setupMediaControlUI(metadata, positionState) {
|
||||||
if (this.isSharing) return;
|
|
||||||
this.updatePipButton();
|
this.updatePipButton();
|
||||||
|
|
||||||
if (!this.mediaControlBar.classList.contains('playing') && this._currentMediaController.isPlaying) {
|
if (!this.mediaControlBar.classList.contains('playing') && this._currentMediaController.isPlaying) {
|
||||||
@@ -324,7 +325,7 @@
|
|||||||
lastUpdated: Date.now(),
|
lastUpdated: Date.now(),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!this._currentBrowser) {
|
if (!this._currentBrowser && !this.isSharing) {
|
||||||
this.setupMediaController(mediaController, browser);
|
this.setupMediaController(mediaController, browser);
|
||||||
this.setupMediaControlUI(metadata, positionState);
|
this.setupMediaControlUI(metadata, positionState);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user