在浏览器中检测显示类型(投影仪) [英] Detect Display Type (Projector) from within the browser
问题描述
它是这样的,我们需要检测,如果显示器是投影(或者如果系统连接到一个Projetor)
It goes like this, we need to detect if the display is a Projector (or if the system is connected to a Projetor).
渔获这应该是在浏览器中完成的。
the catch is this should be done from within the browser.
这样才有可能通过这样做的。
so is it possible to do so by using an
Java小程序
闪存
的ActiveX(这不会约束到一个单一的浏览器,因此不是一个选项)
ActiveX (this does constrains to a single browser, so not an option)
搜索迄今只有reaveals显示分辨率。希望如果有一些仍然在那里。 。
searching so far only reaveals display resolution. expecting if there is something still out there. . .
编辑:accecpted答案是Java小程序的方法。希望有可能是一个更简单的方法,通过闪光...
accecpted answer is for Java Applet approach. hope there may be an easier way through flash...
推荐答案
一个正常的Java小程序将无法告诉你无论你是通过查看一台投影机。
A normal Java Applet will not be able to tell you whether you're viewing through a projector.
如果你能发现无论你是从本地code投影机上运行,那么你可以code库达这样做,并从JNI您的Applet访问它。您需要登录您的小程序,并与AccessController.doPrivileged包装您的库加载()
If you can detect whether you're running on a projector from native code then you could code a library up to do so and access it from your Applet with JNI. You'll need to sign your applet and wrap your library loading with AccessController.doPrivileged()
下面是最后一点是如何工作的解释:
的http://download.oracle.com/javase/1.4.2/docs/api/java/security/AccessController.html
Here's explanation of how that last bit works: http://download.oracle.com/javase/1.4.2/docs/api/java/security/AccessController.html
从各方面来看,Java Web Start的提供使用从Java虽然DLL的一个更容易的路径:
http://mindprod.com/jgloss/jni.html#APPLETS
By all accounts, Java Web Start provides an easier path for using DLLs from Java though: http://mindprod.com/jgloss/jni.html#APPLETS
这篇关于在浏览器中检测显示类型(投影仪)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!