[英]How can I turn the TV/display on and off from the app installed on Android box which is connected via HDMI?
These are my specifications:这些是我的规格:
Angular CLI: 8.1.3
Node.js : 14.13.1
OS : Windows 10 x64
Angular : 8.1.3
TypeScript : 3.4.5
Webpack : 4.39.2
Currently I'm working on a digital signage project.目前我正在从事数字标牌项目。 I have built two apps with Cordova .我用Cordova构建了两个应用程序。 One for administrator control and another one needs to be installed on an android box let's say it's a client app.一个用于管理员控制,另一个需要安装在 android 盒子上,假设它是一个客户端应用程序。
The administrator will be able to create content, upload videos and photos.管理员将能够创建内容、上传视频和照片。 And the uploaded media needs to tagged with with the client app.上传的媒体需要用客户端应用程序标记。
The client app fetches the tagged data from the server and displays on the TV...客户端应用程序从服务器获取标记数据并显示在电视上......
I've managed to get above things correct.我已经设法把事情弄对了。 But, now I need help.但是,现在我需要帮助。
There will be configurations on the administrator app which are saved in the database and can be fetched by the client app.管理员应用程序上会有配置,这些配置保存在数据库中,可以由客户端应用程序获取。 And also there'll be a configuration for turning the TV on and off via hdmi-cec.并且还将有一个通过 hdmi-cec 打开和关闭电视的配置。
I installed the app in an Android box and connected the box to the LED TV via HDMI.我将应用程序安装在一个 Android 盒子中,并通过 HDMI 将盒子连接到 LED 电视。 I need to send a turn off signal to the TV (the Android Box stays on. Only the TV will be turned off) when the user clicks the turn off button.当用户单击关闭按钮时,我需要向电视发送关闭信号(Android 盒子保持打开状态。只有电视会关闭)。 And the TV needs to be turned on when the user clicks to turn the on button.并且当用户点击打开按钮时需要打开电视。
Is there a way to turn the TV/display on and off from the app installed on the Android box which is connected via HDMI?有没有办法通过安装在通过 HDMI 连接的 Android 盒子上的应用程序打开和关闭电视/显示器?
As far as I know, this is not possible in the regular Android Tv Box API. Some tv's do have a non-public REST API or other APIs that they provide to certain manufacturers on demand.据我所知,这在常规 Android 电视盒 API 中是不可能的。有些电视确实有一个非公开的 REST API 或他们按需提供给某些制造商的其他 API。 These are mostly used by apps to turn on or off the TV itself.这些主要由应用程序用来打开或关闭电视本身。
However, you can try turning the brightness to 0% to imitate it being turned off.但是,您可以尝试将亮度调至 0% 以模拟它被关闭的效果。 Also, you can try using a power manager and wake locks if they are available on the Android Tv Box API.此外,如果 Android 电视盒 API 上可用,您可以尝试使用电源管理器和唤醒锁。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.