如何使用MediaSessionCompat,并保持与RemoteControlClient向后兼容? [英] How to use MediaSessionCompat and keep backward compatibility with RemoteControlClient?

查看:688
本文介绍了如何使用MediaSessionCompat,并保持与RemoteControlClient向后兼容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要取代我的Andr​​oid RemoteControlClient类我用一个新的使用MediaSession的应用程序,但无法正常工作与API级< 21,MediaSessionCompat似乎没有崩溃旧设备的工作,但不显示更多的艺术品或歌曲的相关信息上的LockScreen ...

I want to replace my android RemoteControlClient class in my application with a new one using MediaSession, but that not working with API level < 21, MediaSessionCompat seem to work without crashing old devices, but no more ARTWORK or song infos on the LockScreen is displayed...

任何片段或相关信息给我吗?

Any snippet or infos for me ?

谢谢大家!

推荐答案

由于支持-V4磁带库的修订22日,<一个href="https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/v4/java/android/support/v4/media/session/MediaSessionCompat.java"相对=nofollow>来源$ C ​​$下MediaSessionCompat 显示,它现在将自动注册和切换到前 RemoteControlClient 的API 14-20设备使用 MediaSession 上API21 +设备。

As of revision 22 of the Support-v4 library, the source code for MediaSessionCompat shows that it now will automatically register and use a RemoteControlClient in API 14-20 devices before switching to MediaSession on API21+ devices.

这篇关于如何使用MediaSessionCompat,并保持与RemoteControlClient向后兼容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆