I’m trying to implement the media session API on an app with geckoview.
I followed another Stackoverflow post, where it says to insert a delegate. This is my code:
GeckoView view = findViewById(R.id.geckoview);
GeckoSession session = new GeckoSession();
GeckoRuntime runtime = GeckoRuntime.create(this);
session.open(runtime);
view.setSession(session);
MyMediaSessionDelegate myDelegate = new MyMediaSessionDelegate();
session.setMediaSessionDelegate(myDelegate);
session.loadUri("https://googlechrome.github.io/samples/media-session/audio.html");
This is my delegate :
public class MyMediaSessionDelegate implements MediaSession.Delegate {
@Override
public void onActivated(GeckoSession session, MediaSession mediaSession) {
Log.d("dev", "onActivated fired");
} ....
but I don’t get any logs when I start the application. As if the delegate didn’t work.
Notification enabled.