Android中的Chromecast和HDMI-CEC

时间:2021-12-05 19:05:16

As I can see, Chromecast supports HDMI-CEC to control TV, for example - switch TV input. But I did not found in the documentation how it can be implemented. Is SDK for Android support TV control through HDMI-CEC? And if so - what methods and classes I must use to control it?

我可以看到,Chromecast支持HDMI-CEC来控制电视,例如 - 切换电视输入。但我没有在文档中找到它是如何实现的。 SDK for Android是否支持通过HDMI-CEC控制电视?如果是这样 - 我必须使用哪些方法和类来控制它?

1 个解决方案

#1


5  

If HDMI-CEC is supported on your TV, you don't need to do anything extra from your android application; when user connects to your cast device, TV will be automatically turned on and input source will switch appropriately. On your receiver, there are a couple of things that you can do if you wish, and if the HDMI stack supports it: for example if you are casting a video to your chromecast device and user grabs the remote control and switches the input away from your chromecast input, you will receive a webkitvisibilitychange event in your receiver app so you can, say, pause the video.

如果您的电视支持HDMI-CEC,则无需在Android应用程序中执行任何额外操作;当用户连接到您的演员设备时,电视将自动打开,输入源将正确切换。接收器上,有一对夫妇的事情,如果你愿意,你可以做,如果HDMI堆栈支持它:例如,如果您正在投放影片至Chromecast设备和用户抓起遥控器和切换输入远您的chromecast输入,您将在接收器应用程序中收到webkitvisibilitychange事件,以便您可以暂停视频。

#1


5  

If HDMI-CEC is supported on your TV, you don't need to do anything extra from your android application; when user connects to your cast device, TV will be automatically turned on and input source will switch appropriately. On your receiver, there are a couple of things that you can do if you wish, and if the HDMI stack supports it: for example if you are casting a video to your chromecast device and user grabs the remote control and switches the input away from your chromecast input, you will receive a webkitvisibilitychange event in your receiver app so you can, say, pause the video.

如果您的电视支持HDMI-CEC,则无需在Android应用程序中执行任何额外操作;当用户连接到您的演员设备时,电视将自动打开,输入源将正确切换。接收器上,有一对夫妇的事情,如果你愿意,你可以做,如果HDMI堆栈支持它:例如,如果您正在投放影片至Chromecast设备和用户抓起遥控器和切换输入远您的chromecast输入,您将在接收器应用程序中收到webkitvisibilitychange事件,以便您可以暂停视频。