Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent a monitor from sleeping while watching html 5 animation

Tags:

Is there a way to prevent a monitor from sleeping while on a web page?

I have a page with an animation in html that doesn't require user interaction. The monitor can sleep during this and I want to prevent this.

When watching a video on Hulu, I notice that the monitor doesn't sleep so there must be some way to prevent this.

like image 445
Tom Kincaid Avatar asked Feb 05 '13 16:02

Tom Kincaid


Video Answer


2 Answers

The talk about Flash got me wondering, so I made a simple move that just loops a short flv file. Lo and behold when on this page, the monitor doesn't sleep! So all I need to do is make a little movie that's just the background color of the page and loop that on pages where I don't want the monitor to sleep.

like image 163
Tom Kincaid Avatar answered Oct 23 '22 16:10

Tom Kincaid


It's not possible in pure HTML. Hulu does it because it's Flash-based, and the plugin has access to the OS layers, which is something JS or HTML does not have. So the only way to do this would be to have a new paragraph in the HTML5 spec.

I suppose that the browser will disable sleep when going fullscreen, but it's to be verified.

See this post for more info.

like image 38
CharlesB Avatar answered Oct 23 '22 16:10

CharlesB