Android 通过HDMI显示

Android Display via HDMI

我有一个客户想要一个可以将视频从平板电脑播放到连接的 HDMI 屏幕的应用程序。我想知道是否可以在 HDMI 屏幕上显示与平板电脑本身不同的输出?这是因为我想添加一个菜单(位于平板电脑屏幕顶部的层),客户端可以访问该菜单,而看到电视屏幕的人看不到该菜单。

感谢您的帮助。

这是可能的,因为 Android 4.2,请参阅 release notes,其中还包含代码示例:

Android now allows your app to display unique content on additional screens that are connected to the user’s device over either a wired connection or Wi-Fi. To create unique content for a secondary display, extend the Presentation class and implement the onCreate() callback. Within onCreate(), specify your UI for the secondary display by calling setContentView(). As an extension of the Dialog class, the Presentation class provides the region in which your app can display a unique UI on the secondary display.

SDK 中的 Presentation Class 包含一个代码示例,说明如何在第二个屏幕上同时播放视频和显示一些信息。