Closed woutrikkerink closed 1 year ago
It should not be necessary to add anything else. The media notification should show up as soon as the playback state is set to "playing" using MediaSession.setPlaybackState({ playbackState: "playing" });
. You could try calling this function directly at the start of the app to make sure that it definitely gets called and see if that changes something? What Android version are you testing this on and which version of the plugin are you using? And are there maybe any error or log messages that could relate to this problem?
Stupid me. I had some code (a level higher) that was checking for MediaSession support before loading the MediaSession module.
supportsMediaSessionApi() {
return ('mediaSession' in navigator);
}
I see your class MediaSessionWeb is doing the same, so I could safely remove this check on my side. Solved. Thanks for your reply.
MediaSession is working flawless in web application, but does not want to show up on Android. It is a Nuxt (vuejs) application using Howler as audio player (in html5 mode). Capacitor version is 4.6.2.
Do I need to add something to AndroidManifest and/or MainActivity besides this command?