android - 为什么 PlayerNotificationManager 在 Android 11(R) 的 startForeground 上不显示通知?
问题描述
我正在使用带有 Exoplayer 的 PlayerNotificationManager,并且在 startForeground() 上最多可以看到 Android 10 通知托盘,但是当我升级到 Android 11 时,在我的一部手机中,媒体播放器的通知托盘停止显示。
请帮忙!!
在这里,我在 Google Pixel Now 上进行了调试:
适用于 Google Pixel android 11 但不适用于三星 G973F。为什么这不适用于三星?
解决方案
在这里,我在 git ExoPlayer 上出现了问题,这是一个特定于设备的问题,所以,这里是该问题的链接,
https://github.com/google/ExoPlayer/issues/8500
将 MediaSessionConnector 与 ExoPlayer PlayerNotificationManager 和 MediaSessions 一起使用:
https://github.com/google/ExoPlayer/tree/release-v2/extensions/mediasession
这里更简单地使用了 MediaSession 和 MediaSessionConnector:
https://developer.android.com/codelabs/supporting-mediasession
推荐阅读
- oracle-cloud-infrastructure - 即使我有正确的默认配置文件,OCI CLI 也无法从配置文件加载默认配置文件
- kotlin - 在 withContext 之后切换协程上下文
- azure-devops - 检测是否在 Azure DevOps 管道中运行?
- python - 如何在 python 的帮助下跟踪和显示 HDF5 文件中所做的不断变化
- powerbi - Power BI 本地报表服务器 - 如何增加报表会话超时
- laravel - 使用 Laravel Sail 在 ubuntu 21.04 上定位 msodbcsql17 的问题
- python - 如何添加具有非均匀间隔和不同比例的辅助 matplotlib 轴
- c++ - 在共享库中隐藏私有符号的定义
- java - JDK14中的AbstractQueuedSynchronizer在使用setPrevRelaxed时如何保证内存可见性?
- c# - 有没有办法忽略反序列化中的某些字符?