Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dirty hack to enable mediaSession integration when playing with Aurora
In all browsers today, the mediaSession API has been limited to work only when there is an Audio element (with a valid src) in the scope. Because of this, the media controls were not available while playing with the Aurora.js backend. This is now worked around by initializing a dummy Audio element when playback with Aurora.js starts. On Firefox, there was such an extra requirement that the Audio element must not be completely silent (i.e. just silent audio src didn't work, nor setting the volume to exactly 0). Hence, our dummy audio content actually has some sound but it's played in extremely quiet volume, making it impossible to hear. The proper solution for the issue would be for the browsers to implement the audio focus API (see w3c/mediasession#277). This has been first suggested years ago but so far there's no known progress.
- Loading branch information