I need to track if users are clicking on MediaNotification and PiP actions (buttons). I tried various things such as:
- MediaControllerCompat.Callback (Catching android media button events)
- MediaSessionConnector.setMediaButtonEventHandler
- Writing my own BroadcastReceiver and overriding MediaButtonReceiver
- https://developer.android.com/guide/topics/media/media-controls, https://android-developers.googleblog.com/2020/08/playing-nicely-with-media-controls.html
Nothing of the above worked. The events are not being registered in the app. The only place I found that I can get all of media events is if override onEvents method in exoPlayer. But there I can't differentiate if the event was triggered from the notification or in the app.
Currently we have an app that is playing both audio and video. We implemented tracking for all in-app players but need to extend our tracking to MediaNotification and PiP player.
Any ideas how I can listen to MediaNotification and PiP events specifically?