update position state on audible state change

This commit is contained in:
Slowlife01
2025-03-13 09:21:45 +07:00
parent fff8b3f532
commit 4c74517e9e
2 changed files with 15 additions and 1 deletions

View File

@@ -99,7 +99,8 @@ class ZenMediaController {
* @param {Object} browser - The browser associated with the media controller.
*/
activateMediaControls(mediaController, browser) {
if (this._currentBrowser) this.updateMuteState();
this.updateMuteState();
if (this._currentBrowser?.browserId === browser.browserId) return;
else {
this.deinitMediaController(this._currentMediaController);
@@ -271,6 +272,7 @@ class ZenMediaController {
}
updateMuteState() {
if (!this._currentBrowser) return;
if (this._currentBrowser._audioMuted) {
this.mediaControlBar.setAttribute('muted', '');
} else {

View File

@@ -0,0 +1,12 @@
diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp
index 0b8dee1ca22b1f0ddcf7e6a976f606990104b56e..a3a5a7cfcaa8a4719e56988bc917183fa3cc9d10 100644
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -455,6 +455,7 @@ class HTMLMediaElement::MediaControlKeyListener final
// audible state. Therefore, in that case we would noitfy the audible state
// when media starts playing.
if (mState == MediaPlaybackState::ePlayed) {
+ NotifyMediaPositionState();
NotifyAudibleStateChanged(mIsOwnerAudible
? MediaAudibleState::eAudible
: MediaAudibleState::eInaudible);