w3c / audio-session

https://w3c.github.io/audio-session/
Other
0 stars 2 forks source link

Does media session work with WebAudio? #10

Closed mmontag closed 4 weeks ago

mmontag commented 5 years ago

Explainer says:

A music website can tell the user agent that it wants to receive "previous/next track" commands, so that it can switch tracks when these commands are received.

Sounds great!

README says:

Access to media keys and lock screen UI will only be granted when audio playback begins, ensuring that audio focus is not taken from another application prematurely and that lock screen UI is only shown when it can be used.

Oh...so what determines "when audio playback begins"?

In Chrome 73 it seems that an \

1) Is Chrome doing this right? I filed an issue https://bugs.chromium.org/p/chromium/issues/detail?id=944538 2) Can we update the README and Explainer based on the outcome of these discussions: https://github.com/WICG/mediasession/issues/1 https://github.com/WICG/mediasession/issues/9 https://github.com/WICG/mediasession/issues/14 https://github.com/WICG/mediasession/pull/17 https://github.com/WICG/mediasession/issues/48

voxpelli commented 5 years ago

Seems like any mention of WebAudio/AudioContext/"audio-producing objects" that was introduced in w3c/mediasession#48 was removed in w3c/mediasession#135 in an effort to "Updating the spec to match current explainer" – without any easily discoverable explanation on why

mounirlamouri commented 5 years ago

To handle Web Audio, we need to go through the Audio Focus API as Web Audio doesn't take audio focus by default on all browsers and changing would have significant side effects.

rektide commented 2 years ago

w3c/mediasession#277 indicates Audio Focus API is not active or being pursued. Is there something more in-reach that can be done to make WebAudio capable of working with MediaSessions?

eric-carlson commented 1 year ago

The Media WG is reviving the Audio Focus API, retitled the Audio Session API

youennf commented 1 year ago

Right, I would think that if WebAudio is used with an audioSession type equal to "playback", starting web audio should make the media session becoming active. Moving this issue to audio session API.

youennf commented 4 weeks ago

Closing this issue as this now works as expected on Safari: https://jsfiddle.net/pxma30fg/

lucas42 commented 3 weeks ago

@youennf The mediasession calls in that jsfiddle aren't working for me on the latest stable version of Safari [Version 18.0 (20619.1.26.31.6) on Sequoia 15.0 (24A335)]. Is it a pre-release version that it's now working on?