聆听中间化/PIP关键事件 - Android
我需要跟踪用户是否单击中间化和PIP操作(按钮)。 我尝试了各种事情,例如:
- MediaControllerCompat.callback()
- MediaSessionConnector.SetMedMediabuttoneventHandler
- 写我自己的广播和覆盖MediaButtonReceiver
- https://android-developers.googleblog.com/2020/08/playing-nicely-with-with-with-media-controls.htmls.html
上述工作。这些事件未在应用程序中注册。 我发现唯一可以获得所有媒体事件的地方是如果替代者在外层中覆盖Onevents方法。但是在那里,我无法区分事件是从通知还是在应用程序中触发的。
目前,我们有一个正在播放音频和视频的应用程序。我们为所有应用程序内玩家实施了跟踪,但需要将跟踪扩展到中间化和PIP播放器。
有什么想法我如何专门聆听中间化和PIP事件?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以跟踪PIP事件
You can track pip events like so