I have created an HTML audio player in HTML/Javascript for playlists. The playlist is managed internally through a list of media and the ended event automatically plays the next media in line.
From Android Bromite browser, I can play a media and things behave properly. The Android notifications card shows the media playback controls (previous, next, pause), but only the play/pause works.
How could I connect my next/previous Javascript methods (working fine when called from the player HTML buttons) to Android next/previous playback controls ? The HTMLMediaElement API seems to have a audioTracks property that could do it, but it's currently supported by only Safari.
I found it by accident, looking for picture in picture, on https://googlechrome.github.io/samples/picture-in-picture/audio-playlist
Here is the relevant code :
More info here : https://developer.mozilla.org/en-US/docs/Web/API/MediaSession