通过锁定屏幕上的硬件按键可访问音量控制 [英] Provide access to the volume control via hardware buttons on Lock screen

查看:209
本文介绍了通过锁定屏幕上的硬件按键可访问音量控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在锁定模式下,当不投我的应用程序调节媒体音量,但它没有这样做,而当我铸造。

In locked mode, when not casting my app adjusts the media volume but it fails to do so while when I'm casting.

任何想法?

推荐答案

您可以看一下CastCompanionLibrary(CCL),在Vi​​deoCastManager类,看看它是如何做(假设你已经测试了CastVideos,Android的,这是这样做,你期望的那样)。您是否使用RemoteControlClient(RCC)?有一件事是尝试注册与AudioManager碾压实例:

You can look at the CastCompanionLibrary (CCL), in VideoCastManager class, to see how it is doing it (assuming you have tested the CastVideos-android and that is doing it as you expect). Are you using RemoteControlClient (RCC)? One thing to try is to register the RCC instance with the AudioManager:

registerRemoteControlClient(RemoteControlClient RC客户机)

如果你看看在<α SETU premoteControl(..)方法href=\"https://github.com/googlecast/CastCompanionLibrary-android/blob/master/src/com/google/sample/castcompanionlibrary/cast/VideoCastManager.java\"相对=nofollow>在CCL项目VideoCastManager ,你应该能够得到它的工作。注意,此功能不适用于旧版本的Andr​​oid。

If you look into setUpRemoteControl(..) method in VideoCastManager in the CCL project, you should be able to get it to work. Note that this feature is not available on older versions of Android.

这篇关于通过锁定屏幕上的硬件按键可访问音量控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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