-
Notifications
You must be signed in to change notification settings - Fork 168
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
Expose AudioContext in Worker/ServiceWorker #2383
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
AudioWG calls: The worker case is WebAudio/web-audio-api-v2#16, and this is agreed upon and will happen and yes, transferable For the service worker case, it's really unclear. If an app starts playing audio, and then all tabs for this app are closed, how do you pause the audio? There is no way to display a UI element. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Teleconf: As we already agreed on supporting a Worker, we'll work on that first, and ServiceWorker at a lower priority while we gather info on use cases and implications of supporting that. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I'd like to add in another use case here: performance in complex production apps. If AudioContext is available in worker threads, it means that a worker thread can be dedicated specifically to schedule events on the AudioContext (param automation, creating/connecting nodes), without any interference caused by potential main thread load, most commonly caused by UI/DOM (which can be optimized by itself of course). |
how is this different from #2423 ? |
This comment was marked as off-topic.
This comment was marked as off-topic.
As per my understanding |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
2022 TPAC: |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
2023 TPAC Audio WG Discussion: The WG will not pursue this. |
To add: To make this idea work, the lifetime of ServiceWorker and how it interacts with BaseAudioContext needs to be clearly defined. The WG believes that this line of work is outside the scope of the current charter. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@padenot @hoch It was left open before to track this request, any suggestion of where else a request for some kind of audio support in the background can be filed? Through ServiceWorker, SharedWorker or something else. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@voxpelli The roadmap for this work is unclear to me because of the complexity of the interaction between ServiceWorker and AudioContext. I think we need at least two things to reopen and reprioritize this issue in the Audio WG:
Also, closing this issue only means that the WG has other priorities. When the priority changes in the future, the group will definitely reopen this and invite more opinions. @padenot Please feel free to add any other rationales you have in mind. |
I generally agree with what @hoch said. Audio playback on the web is fundamentally tied to an active document for a host of reasons, and this would be a fundamental change to how a User-Agent is expected to behave by its users. To take a parallel, on mobile or desktop, in native, there's always something (an app, a command-line program, a widget, or sometimes the system itself in the case of a notification) that is the cause of the sound, and the user can understand what's going on and can easily interact with the thing that is making sound, for example to pause the audio playback. I'm not saying it's impossible, but rather than there are significant challenges to overcome before this can be worked on. It's also unclear to me what use-cases this would solve. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Extensions have documents and ways to interact with the code that runs via widgets.
If you want to be able to get a tab out of the way, ask the browser vendor to provide a way to do so. This has nothing to do with audio playback from a service worker. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Not being able to use For example, in a web-based music streaming app, I can use But the playback itself must happen in one of the tabs, if the user closes that tab, the playback stops. I can't resume it in another tab because starting an I'm not talking about "retain service worker and play audio from it even if it has 0 clients/documents", only allowing tabs to be freely closed/reloaded (because service worker can live through reloading last tab) would be a huge improvement. Similar story for Media Session API. I have used https://github.com/sinono3/souvlaki to integrate OS media control in an Electron app, for all of Windows, Linux and macOS, they don't need a window to have media session displayed and controlled. |
Describe the feature
Expose
AudioContext
inWorker
andServiceWorker
contexts.Is there a prototype?
No.
Currently users need to use Native Messaging to run local media players, for example
mpv
https://github.com/mpv-player/mpv; see https://github.com/mpv-player/mpv/blob/bc9d556f3a890cf5f99e9dced0117e2d8a91ff09/DOCS/man/javascript.rst, https://github.com/Kagami/mpv.js.Describe the feature in more detail
The ability to use
AudioContext
in aWorker
, particularly in aServiceWorker
context.See https://bugs.chromium.org/p/chromium/issues/detail?id=1131236.
Use cases:
<iframe>
or a dedicatedDocument
just to play audio.The text was updated successfully, but these errors were encountered: