简体   繁体   中英

Detect if monitor is powered on from IE Kiosk mode

I developed a web app to display a slideshow, and want to display it on my secondary monitor (Connected via HDMI) with IE's Kiosk mode on Windows 10. Because of CPU and other resources on the shared server, I want to pause the slideshow when the monitor is powered off. (And therefore nobody is seeing it)

Is there a way to detect connected displays from Internet Explorer? Since this is a one-pc kiosk setup, add-ons, etc. are accepted. Triggering javascript/jquery events would be ideal. Thank you!

No, there is no reliable way to detect if a second monitor is physically switched off but still connected via the cable.

I have to ask though: why do you need to physically switch the second monitor off?

As an alternative could you not:

  • Have the slideshow stop after a timed duration unless it receives an input?
  • Have the slideshow only on display at certain times of the day?
  • Accept events from, say, a node server to control when to and not show the slideshow?

Having said that these threads could provided you, albeit unreliably apparently, what you need:

You can't do in javascript. Why not try some asp component.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd162617%28v=vs.85%29.aspx

You could potentially write a command line program that sits on a particular port, continuously checks for that locally and then use HTML5 WebSockets in IE to communicate with it?

ie C# PowerModeChangedEvent

SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler( SystemEvents_PowerModeChanged );

I don't think so....

CPU cycles are paused when the client computer is put into Sleep mode. (win+L)

Start>Control Panel>Power

configures how the monitor(s) behave when the client is powered down or put to sleep mode.

the screen object in js returns the metic values (height/width) of the screen object but not its powered state.

the impact of wasted CPU cycles on a powered down secondary monitor should be un-noticable....

probably you have not selected the option to "Use software rendering instead of GPU rendering" on the Advance tab of internet options....

You will notice that your CPU on your desktop will throttle up and the cooling fan will race if you haven't set the above setting when running graphic intensive web pages or canvas scripts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM