Added MediaSession support (notification controls on mobile)
Implemented MediaSession support (show playing track and expose playback controls in a notification on mobile). Works great in Chrome, somewhat buggy in Firefox Nightly for now (no prev/next buttons, incorrect playback state).

One ugly hack I had to add is an <audio> tag with a 5-second silent mp3 file, because the current MediaSession API spec draft requires an html audio/video to be playing for it to work, and audio files shorter than 5 seconds don't count? I hope the final version of the spec makes more sense.
@R0nd, Thank you for the contribution, the idea looks very promising. I've left few improvement suggestions.
One ugly hack I had to add is an
<audio>tag with a 5-second silent mp3 file, because the current MediaSession API spec draft requires an html audio/video to be playing for it to work, and audio files shorter than 5 seconds don't count? I hope the final version of the spec makes more sense.
This has possible unintended effect effect of draining mobile battery for playing silence. I think it's fine to keep this as that for now, probably makes sense to add setting to disable this feature completely. I could help you with that.
I think it's fine to keep this as that for now, probably makes sense to add setting to disable this feature completely.
I've added a setting to enable this feature. I've made it disabled by default, since there's no data on performance impact yet and browser support isn't 100% there.
@R0nd sorry for delay, I'm on vacation at the moment, would merge it when I'm back, have a nice day!
I've added a setting to enable this feature. I've made it disabled by default, since there's no data on performance impact yet and browser support isn't 100% there.
Probably it would be better to avoid <audio> completely if setting is disabled.
Brace formatting still does not match other source files: { should be on the next line for control statements and declarations, for object expressions could be on the same line. Short example of the described style.