Add MediaController API to set media metadata
Categories
(Core :: Audio/Video: Playback, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: alwu, Assigned: alwu)
References
Details
Attachments
(7 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Now I'm thinking about exposing methods on MediaController
to allow us set media metadata, and create a generic interface, which would be used in MediaController
, as an abstract layer in order to use platform-specific API to set the metadata's infomation on the visual controller interface, for example, MPRIS on Linux, SMTC on Windows, MediaController on Android.
Assignee | ||
Comment 1•6 years ago
|
||
Now I'm implementing this one, and it's based on the work of bug1592454.
Assignee | ||
Comment 2•5 years ago
|
||
Now I'm working on it, but I don't know if I can successfully fix it in this release cycle, so I would target this in the next cycle for now.
Assignee | ||
Comment 3•5 years ago
|
||
Assignee | ||
Comment 4•5 years ago
|
||
emplace
can only be used on an empty Maybe
, but in our case, we can update the metadata anytime even if we have set the metadata before, so using Some()
is actully the right way.
Assignee | ||
Comment 5•5 years ago
|
||
Assignee | ||
Comment 6•5 years ago
|
||
Assignee | ||
Comment 7•5 years ago
|
||
Assignee | ||
Comment 8•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 9•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 10•5 years ago
|
||
Here is a short brief-up for what I've done in this bug and why we need these patches.
For the media control, some platforms would display a system level virtual media control interface to allow user control media directly without opening a specific application. On that interface, we would have some control buttons, such as play/pause
, prev song
and next song
, and the metadata information that would show what media user is currently playing. The metadata might contains artist title, album name and album cover.
Currently we would show this kind of control interface on Windows and Linux (Android is using their own Android component so it's not related what we do here), so we would like to implement a method on the MediaControlKeysEventSource
, that is an interface which we use to encapsulate the details of handling media keys on different platforms, to allow each platform to set metadata via platform specific API.
In addition, MediaSession API provides a way to allow website to customize their own metadata [1]. In this bug, we would propagate that metadata to the media controller in the chrome process, and then update that metadata to the MediaControlKeysEventSource
in order to display metadata on the virtual media controller interface.
If the website which is playing media doesn't use MediaSession API, or the media session it uses doesn't contain any metadata or an empty metadata [2], then we would generate a default metadata, which would use website's title as artist name and default favicon icon as an artwork.
[1] https://w3c.github.io/mediasession/#examples
[2] https://w3c.github.io/mediasession/#empty-metadata
Updated•5 years ago
|
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0f698a08a024
https://hg.mozilla.org/mozilla-central/rev/5e8de6ea0c6e
https://hg.mozilla.org/mozilla-central/rev/06edd39ee3a0
https://hg.mozilla.org/mozilla-central/rev/b27118f20ad5
https://hg.mozilla.org/mozilla-central/rev/0a99bf156346
https://hg.mozilla.org/mozilla-central/rev/436c85047eaf
https://hg.mozilla.org/mozilla-central/rev/79eed382da77
Description
•