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

爷,独闯天下 提交于 2019-12-30 06:00:31

问题


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 longer 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.


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/7702748/how-does-youtube-prevent-the-screensaver-from-showing-up-during-video-playback

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