Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does media session work with WebAudio? #11

Open
mmontag opened this issue Mar 21, 2019 · 5 comments
Open

Does media session work with WebAudio? #11

mmontag opened this issue Mar 21, 2019 · 5 comments
Labels
TPAC2024 Topic for discussion at TPAC 2024

Comments

@mmontag
Copy link

mmontag commented Mar 21, 2019

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 <audio> or <video> element needs to be streaming audio and the WebAudio/AudioContext use case requires hacks.

  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: Collect media keys use cases mediasession#1 Figure out the coupling between audio focus/session, audio playback and remote control events mediasession#9 Making this work with Flash mediasession#14 Simplify MediaSession somewhat to not require audio playback mediasession#17 Integrate with Web Audio mediasession#48
@voxpelli
Copy link

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
Copy link
Member

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
Copy link

rektide commented Jul 30, 2022

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
Copy link

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

@youennf
Copy link

youennf commented Mar 6, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TPAC2024 Topic for discussion at TPAC 2024
Projects
None yet
Development

No branches or pull requests

7 participants