topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 3:04 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Turn off Screensaver automatically during Youtube  (Read 15277 times)

037

  • Participant
  • Joined in 2008
  • *
  • Posts: 7
    • View Profile
    • Donate to Member
IDEA: Turn off Screensaver automatically during Youtube
« on: January 08, 2008, 12:01 AM »
Dunno if it has been implemented or suggested somewhere already, but I guess it wouldn't hurt to suggest it again.

Currently, we have TrayScreenSaver to manually turn on or off screensaver, but if you really think about it, most of the time we turn off screen saver according to the same logic all the time. For example, it will turn off when we browse Youtube, or when we have a video renderer running. Or for instance, it will turn off only when media player is playing video, but turn timer on when playing audio.

So the idea is, to have a software turning off the screensaver according to a set of rules set by the user. I understand that it is much harder to detect all these circumstances than it sounds, so here is my dissemination:

Example: Turn off Screen Saver on Youtube
Solution:
- Easy Way: Detect if any browsers are open, then see if the window title has the word "Youtube"
- Hard Way: Detect if any Flash ActiveX/plugin is running, and see if the src of the embed has "youtube.com"

This should also work for other video sites.

Example: Turn off Screen Saver when Windows Media Player is playing a video
Solution: This probably need a plugin in WMP to detect what is playing

Thanks! Looking forward to your input. :)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Turn off Screensaver automatically during Youtube
« Reply #1 on: January 08, 2008, 05:09 AM »
I do something similar to this. My computer doesn't lock when i have media play or bsplayer as the active window.

Do you think this should be done as "if windows media player is running" or "if window media player is active window"?

037

  • Participant
  • Joined in 2008
  • *
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Turn off Screensaver automatically during Youtube
« Reply #2 on: January 08, 2008, 09:21 AM »
It can be one of the options, and I think detecting if WMP is the active window is a clever way to determine if you're watching videos.  :Thmbsup:

And yeah, this idea is really for people who watches videos :)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Turn off Screensaver automatically during Youtube
« Reply #3 on: January 09, 2008, 12:48 PM »
Ok, i modified Skrommel's Noise to have this work and attached to this post.

Just download and install autohotkey and run the script.

It'll disable the screensaver when the current window has "youtube" on its title, or when windows media player is the active window.

The best way to add it more rules is by editing the code and adding other stuff after the following lines:

if (WindowClass = WMPlayerApp)
  GoSub, MAKENOISE2

if WindowTitle contains Youtube
  GoSub, MAKENOISE2

Those are the 2 rules it has right now. If you'd like it to make the screensaver not start when opera is the active window, you only needed to add:

if (WindowClass = OpWindow)
  GoSub, MAKENOISE2

or

if WindowTitle contains Opera
  GoSub, MAKENOISE2
After the mentioned lines.

To find out the windowclass of some window, use windowspy (which is included with autohotkey) or Winspector.
« Last Edit: January 09, 2008, 05:56 PM by jgpaiva »

037

  • Participant
  • Joined in 2008
  • *
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Turn off Screensaver automatically during Youtube
« Reply #4 on: January 09, 2008, 02:07 PM »
OH MY GOD!!  :-* Thanks a ton for the script!! I have been waiting for something like this for years. The annoyances of constantly exiting full screen mode will finally be gone.  :D

Upon further research, I noticed that most video sites use Flash anyway, and the Window Class of all fullscreen-ed Flash window is the same, so that I can do:

if (WindowClass = ShockwaveFlashFullScreen)
  GoSub, MAKENOISE2

And as for WMP, I like to turn off Screen Saver only when full screen as well, and it has a different class:
if (WindowClass = WMPTransition)
  GoSub, MAKENOISE2

Thanks so much for the help again!  :Thmbsup:

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Turn off Screensaver automatically during Youtube
« Reply #5 on: January 09, 2008, 03:05 PM »
 ;D ;D

I'm glad you like it, 037 ;)

037

  • Participant
  • Joined in 2008
  • *
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Turn off Screensaver automatically during Youtube
« Reply #6 on: January 09, 2008, 03:56 PM »
Hello, thanks again jgpaiva, I had a lot of fun with AHK. I have one more question...  :) I noticed that I seem to need to Show the "Noise!" window in order to have the Edit1 visible so that random keystrokes can be sent. I tried to modify it but I'm new to AHK... Is there a way so that I don't need to keep the window open? I'm using DimSaver.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Turn off Screensaver automatically during Youtube
« Reply #7 on: January 09, 2008, 04:11 PM »
Oh, you don't need to have it showing.. It works even when it isn't sowing. It sends keystrokes to a hidden window, that still should prevent the screensaver from coming up.

Are you sure the screensaver still comes up?

037

  • Participant
  • Joined in 2008
  • *
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Turn off Screensaver automatically during Youtube
« Reply #8 on: January 09, 2008, 05:28 PM »
Ah... After a few close observations, I found out that this line works:

if WindowTitle contains Youtube

but this line doesnt seem to work:

if (WindowClass = WMPlayerApp)

Any clues?  :'(
Thanks!


EDIT: Aha! Got it, it should be:

if (WindowClass = "WMPlayerApp")
« Last Edit: January 09, 2008, 05:48 PM by 037 »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Turn off Screensaver automatically during Youtube
« Reply #9 on: January 09, 2008, 05:56 PM »
Oh, right.. Oops :)

I fixed the code on my post above too.

dariovolaric

  • Participant
  • Joined in 2009
  • *
  • Posts: 1
    • View Profile
    • Donate to Member
Re: IDEA: Turn off Screensaver automatically during Youtube
« Reply #10 on: January 14, 2009, 10:18 AM »
Hi everyone,

I had a similar problem with my screen saver activating when I don't want it to when certain programs are open. I made an easy little program that simulates pressing the SHIFT key every minute to prevent the screensaver from starting, and even prevent the system from going to standby. You can enter any search phrase (like YouTube).

Have a look at http://cyber-d.blogs...screensaver-101.html

 :D