开发者

How does YouTube prevent the screensaver from showing up during video playback? (Windows)

开发者 https://www.devze.com 2023-04-11 23:02 出处:网络
I have noticed that mi screensaver doesn\'t start while I\'m watching videos on YouTube. I\'m using Windows 7.

I have noticed that mi screensaver doesn't start while I'm watching videos on YouTube. I'm using Windows 7.

This is the test:

  1. Set Windows screensaver to 1 minute.
  2. Browse to YouTube and play a video 开发者_如何学JAVAlonger than 1 minute; ideally much longer.
  3. Note that your screensaver doesn't come up after the specified time (1 minute).

I've tested using Firefox, Chrome and IE8. My Flash Player version is 10.3. (Youtube is using flash to play the videos). The same happens whether I watch the video in full-screen or not.

Does anyone know how they do it?

I've searched but all I found was people saying it's not possible, or tips for users to disable their screensaver while watching videos.


Please review all answers. Don't stick to the most voted.


Someone outside StackOverflow pointed me to this article: http://www.webkitchen.be/2010/04/13/6-lesser-known-features-in-flash-player-10-1/

Disabled screen saver in full screen mode

There’s nothing more annoying than having to press the keyboard or moving your mouse every few minutes to prevent the screensaver from kicking in while watching a video in full screen. Flash Player 10.1 now temporarily disables your screensaver if video is playing and not paused, stopped or buffering. But it also works with audio. So… if you’re running a full screen app that plays audio and it is not paused, stopped or buffering and actually has volume the screensaver will not kick in.

Unfortunately I cannot find an official Adobe source for this. They seem to be so focused on Flash Player 11, that they removed the list of "new features" available since Flash Player 10.

I tested this and it works whether in full screen or not, as long as a video is playing.

I guess the answer to my original question is NOTHING. Flash Player, not YouTube, does it automatically.


I found some documentation at help.adobe.com - Playing video in full-screen mode:

Flash Player and AIR allow you to create a full-screen application for your video playback, and support scaling video to full screen.

For AIR content running in full-screen mode, the system screen saver and power-saving options are disabled during play until either the video input stops or the user exits full-screen mode.


It looks like a Microsoft bug, as mentined below, you can make your presentation in a browser to prevent screensaver. Hope this link helps.

From Issue 9853: Display blanking fails when Chrome has focus:

Comment 8 by *ida...@chromium.org, May 21, 2009
Took some time to look at this and I can confirm that it is easily reproducible and the Chrome does not do anything to affect Windows power management. It really looks like a Microsoft bug which is clearly triggered by Chrome having focus.

To be clear what actually happens is that the 'Display-blanking' power-state does not trigger while Chrome has focus, all other power-states (Suspend, Hibernate) trigger. The screen saver also triggers.

0

精彩评论

暂无评论...
验证码 换一张
取 消