exoplayer - 点击 ExoPlayer 通知打开应用
问题描述
使用 ExoPlayer 和 PlayerNotificationManager 在通知中显示媒体播放进度,现在如何通过单击通知打开应用程序?
解决方案
当您尝试通过 PlayerNotificationManager 创建NotificationChannel 时,您直接在 MediaDescriptor 下覆盖此方法
@Override
public PendingIntent createCurrentContentIntent(Player player){
Intent intent = new Intent(YourService.this,YourMediaActivity.class);
PendingIntent contentPendingIntent = PendingIntent.getActivity
(YourService.this, 0, intent, 0);
return contentPendingIntent;
}
推荐阅读
- docker - 如何在 Kubernetes 中使用现有的 Docker 镜像?
- r - 由于 nlsModel 中的错误,for 循环中的 nls 停止
- sql - Sql Developer - 使用 concat 和 GROUP BY 函数进行计数(错误 ORA-00904)
- unity3d - 10 秒后 Unity 多人游戏中的玩家生成
- c# - NLog:在运行时从模板生成配置
- .htaccess - Laravel 中的自定义 slug (URL)(使用 htaccess 是一个选项)
- javascript - 等待剑道图完全绘制
- reactjs - 如何使用 apache 修改传入的响应标头?
- scala - 运行 Scala 代码时发现类型不匹配
- ios - NSURLErrorDomain:无法连接到服务器