VOOZH about

URL: https://bugzilla.mozilla.org/show_bug.cgi?id=2011420

⇱ 2011420 - Changing MediaMetadata properties does not notify MediaSession


Closed Bug 2011420 Opened 4 months ago Closed 4 months ago

Changing MediaMetadata properties does not notify MediaSession

Changing MediaMetadata properties does not notify MediaSession
Core
Audio/Video: Playback
Firefox 149
All
All
defect
Points:
---
RESOLVED FIXED
RESOLVED
FIXED
149 Branch
Iteration:
---
a11y-review
Accessibility Severity
Performance Impact
Size Estimate
Webcompat Priority
Webcompat Score
Tracking Status
firefox149 --- fixed
Tracking Status
relnote-firefox
thunderbird_esr115
thunderbird_esr140
firefox-esr115
firefox-esr140
firefox-esr153
firefox149
firefox152
firefox153
firefox154
---
QA Whiteboard:
[qa-triage-done-c150/b149]
Has STR:
---
Change Request:
---
Bug Flags:
Signature:
None
This bug is publicly visible.

 
Assignee

Description

β€’
4 months ago

Steps to reproduce:

  1. Open a page that creates a MediaSession and starts media playback.
  2. Assign a MediaMetadata object to navigator.mediaSession.metadata.
  3. After playback has started, update a property on the existing MediaMetadata object (for example, change metadata.title).
  4. Observe the media information shown in system media controls.

Actual results:

The updated metadata is reflected in system media controls.

Expected results:

The media metadata does not update unless a new MediaMetadata object is assigned to navigator.mediaSession.metadata.

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged β†’ Audio/Video: Playback
Product: Firefox β†’ Core

It appears the Chrome does indeed schedule an event to update the session after a MediaMetadata attribute is updated, as it saves a pointer to its owning MediaSession:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/mediasession/media_metadata.cc;drc=731d7da69af6d3c1b97ff8e72cd2b85c872a18a8;l=97
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/mediasession/media_session.cc;drc=731d7da69af6d3c1b97ff8e72cd2b85c872a18a8;l=181

whereas we do nothing when we set the attributes:
https://searchfox.org/firefox-main/rev/93aad2a6615f670b1279c229dd37f7397236131a/dom/media/mediasession/MediaMetadata.cpp#56

when we would want to call MediaSession::NotifyMetadataUpdated just like we do when we set the metadata:
https://searchfox.org/firefox-main/rev/93aad2a6615f670b1279c229dd37f7397236131a/dom/media/mediasession/MediaSession.cpp#121

The W3C MediaSession spec is pretty clear that is what we are supposed to do

When MediaMetadata’s title, artist, album or artwork images are modified, the user
agent MUST run the following steps:

1. If the instance has no associated media session, abort these steps.
2. Otherwise, queue a task to run the following substeps:
 1. If the instance no longer has an associated media session, abort these steps.
 2. Otherwise, in parallel, run the update metadata algorithm. 
Severity: -- β†’ S3
Status: UNCONFIRMED β†’ NEW
Depends on: 1592037
Ever confirmed: true
Flags: needinfo?(alwu)
OS: Unspecified β†’ All
Hardware: Unspecified β†’ All
Assignee: nobody β†’ slowlife1165
Status: NEW β†’ ASSIGNED
Attachment #9538832 - Attachment description: Bug 2011420 - Notify MediaSession when MediaMetadata properties are mutated. r=#media-playback-reviewers β†’ Bug 2011420 - Notify MediaSession when MediaMetadata properties are mutated

Comment 4

β€’
4 months ago
Pushed by alwu@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d3f3f72b83c1 https://hg.mozilla.org/integration/autoland/rev/f4c3cc9c77e7 Notify MediaSession when MediaMetadata properties are mutated r=media-playback-reviewers,alwu
Status: ASSIGNED β†’ RESOLVED
Closed: 4 months ago
Resolution: --- β†’ FIXED
Target Milestone: --- β†’ 149 Branch
Flags: needinfo?(alwu)
QA Whiteboard: [qa-triage-done-c150/b149]

Updated

β€’
3 months ago
Regressions: 2023406

Updated

β€’
3 months ago
See Also: β†’ 1775889

Updated

β€’
3 months ago
See Also: 1775889 β†’
Regressions: 2024448
Regressions: 2025475
You need to log in before you can comment on or make changes to this bug.