-
Notifications
You must be signed in to change notification settings - Fork 3
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
Should we allow linking AudioSessions to each HTMLMediaElement/AudioContext object? #5
Comments
I think it is. A site may have both alert sounds ("transient") and a music stream ("playback"). It would be convenient to allow alert sounds to duck playback the same way a system alert sound would, without requiring the page to "re-invent the wheel" and implement ducking manually. |
The most straightforward API design would involve monkey-patching HTML to add a |
Alternatively, the |
Right, this would require such setters/getters, plus AudioSession constructor, plus requestFocus/releaseFocus. |
For instance partial interface AudioSession {
constructor();
// Request audio focus from the platform. Resolves with true if the request was successful.
Promise<bool> request();
// Abandons audio focus. Rejects with an error if the session does not have audio focus.
Promise<void> abandon();
}; |
+1 one to this question/issue/answer. I support adding a way to allow transient sounds from sites with longer playback. |
Tentative TPAC 2024 proposal: add the following abilities in the roadmap, and discuss whether V1 or not:
|
Is it useful to set a particular AudioSession to a particular HTMLMediaElement/AudioContext?
The text was updated successfully, but these errors were encountered: