0

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.

enter image description here

How can I achieve similar music control widget on Geckoview?

1 Answers1

0

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().

Agi Sferro
  • 626
  • 3
  • 12