How can I setup music player widget in notification bar on Geckoview Android.
It is possible on chrome browser through Media Session Api
Below is the image from chrome browser android.
How can I achieve similar music control widget on Geckoview?
You would have to implement MediaSession.Delegate
and then set it on your session using GeckoSession.setMediaSessionDelegate
.
The onMetadata
method inside Delegate
gives you an instance of MediaSession
that you can use to respond to Android's media notification controls, e.g. to play the current media element you would just have to call mediaSession.play()
.