diff --git a/dom/media/mediacontrol/MediaController.cpp b/dom/media/mediacontrol/MediaController.cpp index b2b3c13ae85a..6b3a31663810 100644 --- a/dom/media/mediacontrol/MediaController.cpp +++ b/dom/media/mediacontrol/MediaController.cpp @@ -170,6 +170,7 @@ void MediaController::Stop() { LOG("Stop"); UpdateMediaControlActionToContentMediaIfNeeded( MediaControlAction(MediaControlKey::Stop)); + MediaStatusManager::ClearActiveMediaSessionContextIdIfNeeded(); } uint64_t MediaController::Id() const { return mTopLevelBrowsingContextId; } diff --git a/dom/media/mediacontrol/MediaStatusManager.h b/dom/media/mediacontrol/MediaStatusManager.h index e7a7a8581166..33c09573861c 100644 --- a/dom/media/mediacontrol/MediaStatusManager.h +++ b/dom/media/mediacontrol/MediaStatusManager.h @@ -212,6 +212,8 @@ class MediaStatusManager : public IMediaInfoUpdater { // media session and owns the audio focus within a tab. Maybe mActiveMediaSessionContextId; + void ClearActiveMediaSessionContextIdIfNeeded(); + private: nsString GetDefaultFaviconURL() const; nsString GetDefaultTitle() const; @@ -221,7 +223,6 @@ class MediaStatusManager : public IMediaInfoUpdater { bool IsSessionOwningAudioFocus(uint64_t aBrowsingContextId) const; void SetActiveMediaSessionContextId(uint64_t aBrowsingContextId); - void ClearActiveMediaSessionContextIdIfNeeded(); void HandleAudioFocusOwnerChanged(Maybe& aBrowsingContextId); void NotifySupportedKeysChangedIfNeeded(uint64_t aBrowsingContextId);