聆听中间化/PIP关键事件 - Android

发布于 2025-02-11 02:16:22 字数 815 浏览 0 评论 0原文

我需要跟踪用户是否单击中间化和PIP操作(按钮)。 我尝试了各种事情,例如:

上述工作。这些事件未在应用程序中注册。 我发现唯一可以获得所有媒体事件的地方是如果替代者在外层中覆盖Onevents方法。但是在那里,我无法区分事件是从通知还是在应用程序中触发的。

目前,我们有一个正在播放音频和视频的应用程序。我们为所有应用程序内玩家实施了跟踪,但需要将跟踪扩展到中间化和PIP播放器。

有什么想法我如何专门聆听中间化和PIP事件?

I need to track if users are clicking on MediaNotification and PiP actions (buttons).
I tried various things such as:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

開玄 2025-02-18 02:16:22

您可以跟踪PIP事件

override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean,newConfig: Configuration?) {
    super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
    if (lifecycle.currentState == Lifecycle.State.CREATED) //On close button clicked
    else if (lifecycle.currentState == Lifecycle.State.STARTED) {
        if (!isInPictureInPictureMode) //On exit pip mode
        else //On enter pip mode
    }
}

You can track pip events like so

override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean,newConfig: Configuration?) {
    super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
    if (lifecycle.currentState == Lifecycle.State.CREATED) //On close button clicked
    else if (lifecycle.currentState == Lifecycle.State.STARTED) {
        if (!isInPictureInPictureMode) //On exit pip mode
        else //On enter pip mode
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文