Detect Display Type (Projector) from within the browser

∥☆過路亽.° 提交于 2019-12-13 04:42:07

问题


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 Applet

Flash

ActiveX (this does constrains to a single browser, so not an option)

searching so far only reaveals display resolution. expecting if there is something still out there. . .

Edit: accecpted answer is for Java Applet approach. hope there may be an easier way through flash...


回答1:


A normal Java Applet will not be able to tell you whether you're viewing through a projector.

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()

Here's explanation of how that last bit works: http://download.oracle.com/javase/1.4.2/docs/api/java/security/AccessController.html

By all accounts, Java Web Start provides an easier path for using DLLs from Java though: http://mindprod.com/jgloss/jni.html#APPLETS




回答2:


Use CSS.

selector {
    property: value1;
}

@media projection {
    selector {
        property: value2;
    }
}

You could use JavaScript to detect the different value. :)

if (element.getPropertyValue(property) === value2) /* Some JavaScript stuff. */


来源:https://stackoverflow.com/questions/5073592/detect-display-type-projector-from-within-the-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!