Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Hide youtube progress bar when in full screen


  • Please log in to reply
22 replies to this topic
anon
  • Guests
  • Last active:
  • Joined: --
When watching youtube videos, I'm always annoyed at the ugly grey bar at the bottom of the screen. I wish it would autohide or if it was a different colour.

So i wrote a very simple script which overlays a black rectangle over the youtube progressbar when in fullscreen. Just press f to toggle the rectangle


#IfWinActive ahk_class ShockwaveFlashFullScreen
f::
if Blocker_check = 1
  {
  Progress, Off
  Blocker_check = 0
  }
  else 
  {
   YT1:= 40
   YT2:= A_ScreenHeight - YT1 
   Progress,B CW000000 ZH0 W%A_ScreenWidth% H%YT1% Y%YT2%
  Blocker_check = 1
  }
return

Esc::
  Progress, Off
  Blocker_check = 0
  Send, {Esc}
return

If there is a better solution to this out there let me know.
thanks

BoBo²
  • Guests
  • Last active:
  • Joined: --
[YouTube Embedded Player Parameters] Something which might be of help (for others).

BoBo²
  • Guests
  • Last active:
  • Joined: --
Might help to use [this] FlashPlayer. Looks highly configurable.

Layout
controlbar (bottom): position of the controlbar. Can be set to bottom, over and none.
controlbarsize (20): height of the controlbar in pixels.
height (400): height of the display (not the entire player!) in pixels.
playlist (none): position of the playlist. Can be set to bottom, over, right or none.
playlistsize (180): size of the playlist. When below or above, this refers to the height, when right, this refers to the width of the playlist.
skin (undefined): location of a SWF file with the player graphics. Here's a tutorial and an overview of supported elements for skinning.
width (280): width of the display (not the entire player!) in pixels.



Anon
  • Guests
  • Last active:
  • Joined: --
@WrongSectionAlert ....sorry if this is this wrong section
:oops:
But i thought it was the right place to post. My intention was to share a script that i'm quite happy with. The question about whether there was a better method was just a secondary thing.

Thanks BoBo2 ...I was thinking more of fullscreen youtube videos rather than the embedded ones.
If you compare youtube to somewhere like dailymotion, they use flash too, but when its in full screen the controlbar autohides, making it a much nicer to watch, especially if you are displaying it on your tv.
Youtube now has long playing, wide screen, high quality videos, ......and it is when watching these that the bar at the bottom becomes annoying for me.

BoBo²
  • Guests
  • Last active:
  • Joined: --
I thought about to call the UTubevid fullscreen within that alternative (embedded) player!?

[brainfart]
A noobish attempt ...

1) create a local webpage with the alternative embbeded (fullscreen) player.
2) create a script (like the one below) which captures/copies the URL of a UTubeVid (the one you wanna play) from the browsers addressbar.

!z:: ; press ALT+z
UTubeRootURL   := "http://www.youtube.com/watch?v="
UTubeVideoURL := "http://s.ytimg.com/yt/swf/watch_v8-vfl67812.swf?video_id="
Send, ^c
StringReplace, VidID, Clipboard, %UTubeRootURL%,,
ClipBoard := UTubeVideoURL . VidID
MsgBox % ClipBoard
Return
3) call your local 'embedded player webpage' (in fullscreen) with the included captured link (via an AHKScript).
[/brainfart]

anon
  • Guests
  • Last active:
  • Joined: --
Thanks BoBo... I think i understand what you mean, I found a grease monkey script that does something similar... i.e. uses an alternative player (FlowPlayer)

However it overlays a logo and doesn't handle widescreen, so i'm am going to stick with my version.

I've updated my code from above to include autohide functionality.... i'm very pleased with it :D


YT1:= 41  ; size of bar, adjust if required (seems to be larger in firefox than ie!!!)
Blocker_check:= 0

; check status every 1 second (timer needs to be at top of script)
#Persistent
SetTimer, YT_autohide, 1000
return 


; check if in falsh full screen mode
#IfWinActive ahk_class ShockwaveFlashFullScreen

YT_autohide:
  ; hide if idle for 5 seconds....
  if ( ((a_timeidle > 5000 and Blocker_check = 0) or KeepHid = 1) and WinExist("YouTube") and WinActive("ahk_class ShockwaveFlashFullScreen"))
  {
     YT2:= A_ScreenHeight - YT1 
     MouseGetPos,, ypos 
	 if (ypos < YT2)   ;don't hide if mouse over control bar
     {
	   Progress,B CW000000 ZH0 W%A_ScreenWidth% H%YT1% Y%YT2%
       Blocker_check = 1
	   SystemCursor("off")
	 }
	 if (a_timeidle < 5000) 
	 {
	  KeepHid = 0
	 }
  }else if( a_timeidle < 1000 and Blocker_check = 1 and WinExist("YouTube") and WinActive("ahk_class ShockwaveFlashFullScreen"))  
  {
     Progress, off
     Blocker_check = 0
	 SystemCursor("on")
  }else if( Blocker_check = 1 and WinActive("ahk_class ShockwaveFlashFullScreen") = 0)  ; if something steels focus restore everything...
  {
     Progress, off
     Blocker_check = 0
	 SystemCursor("on")
  }  
return

Esc::
  Progress, Off
  Blocker_check = 0
  SystemCursor("on")
  Send, {Esc}
return

; 'a' and 'z' adjust the height of the bar...
a::
   YT1:= YT1 + 1
   KeepHid = 1
   YT2:= A_ScreenHeight - YT1 
   Progress,B CW000030 ZH0 W%A_ScreenWidth% H%YT1% Y%YT2%
return

z::
   YT1:= YT1 - 1
   KeepHid = 1
   YT2:= A_ScreenHeight - YT1 
   Progress,B CW000030 ZH0 W%A_ScreenWidth% H%YT1% Y%YT2%
return

; the following send the keyboard shortcuts used in flash v10, without effecting the autohide
left::
  if (Blocker_check = 1)
 {  
 Send, {left}
 KeepHid = 1
 Progress,B CW000000 ZH0 W%A_ScreenWidth% H%YT1% Y%YT2%
 }else 
    Send, {left}
return

right::
  if (Blocker_check = 1)
 {  
 Send, {right}
 KeepHid = 1
 Progress,B CW000000 ZH0 W%A_ScreenWidth% H%YT1% Y%YT2%
 }else 
    Send, {right}
return

up::
  if (Blocker_check = 1)
 {  
 Send, {up}
 KeepHid = 1
 Progress,B CW000000 ZH0 W%A_ScreenWidth% H%YT1% Y%YT2%
 }else 
    Send, {up}
return

down::
  if (Blocker_check = 1)
 {  
 Send, {down}
 KeepHid = 1
 Progress,B CW000000 ZH0 W%A_ScreenWidth% H%YT1% Y%YT2%
 }else 
    Send, {down}
return

Space::
  if (Blocker_check = 1)
 {  
 Send, {Space}
 KeepHid = 1
 Progress,B CW000000 ZH0 W%A_ScreenWidth% H%YT1% Y%YT2%
 }else 
    Send, {Space}
return

;---the following code hides the mouse cursor... taken from the autohotkey help file, via http://www.autohotkey.com/forum/topic6107.html
;SystemCursor("Toggle")  ; Win+C hotkey to toggle the cursor on and off.
SystemCursor(OnOff=1)   ; INIT = "I","Init"; OFF = 0,"Off"; TOGGLE = -1,"T","Toggle"; ON = others
{
    static AndMask, XorMask, $, h_cursor
        ,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 ; system cursors
        , b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13   ; blank cursors
        , h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13   ; handles of default cursors
    if (OnOff = "Init" or OnOff = "I" or $ = "")       ; init when requested or at first call
    {
        $ = h                                          ; active default cursors
        VarSetCapacity( h_cursor,4444, 1 )
        VarSetCapacity( AndMask, 32*4, 0xFF )
        VarSetCapacity( XorMask, 32*4, 0 )
        system_cursors = 32512,32513,32514,32515,32516,32642,32643,32644,32645,32646,32648,32649,32650
        StringSplit c, system_cursors, `,
        Loop %c0%
        {
            h_cursor   := DllCall( "LoadCursor", "uint",0, "uint",c%A_Index% )
            h%A_Index% := DllCall( "CopyImage",  "uint",h_cursor, "uint",2, "int",0, "int",0, "uint",0 )
            b%A_Index% := DllCall("CreateCursor","uint",0, "int",0, "int",0
                , "int",32, "int",32, "uint",&AndMask, "uint",&XorMask )
        }
    }
    if (OnOff = 0 or OnOff = "Off" or $ = "h" and (OnOff < 0 or OnOff = "Toggle" or OnOff = "T"))
        $ = b  ; use blank cursors
    else
        $ = h  ; use the saved cursors

    Loop %c0%
    {
        h_cursor := DllCall( "CopyImage", "uint",%$%%A_Index%, "uint",2, "int",0, "int",0, "uint",0 )
        DllCall( "SetSystemCursor", "uint",h_cursor, "uint",c%A_Index% )
    }
}


Momar
  • Guests
  • Last active:
  • Joined: --
simple but surprisingly effective... cheers Anon!

Can't believe youtube don't do this anyway

rock
  • Guests
  • Last active:
  • Joined: --
im totally new to scripting, all ive ever done with them is save them into script folders... im hoping you can help me out with this

where do i put this or what do i do with it in order to modify the flash player
ive been trying to figure this out for days, if you can help me solve this it really appreciate it
thanks

anon
  • Guests
  • Last active:
  • Joined: --
@ Rock
just download autohotkey.... copy and paste the script into notepad or similar text editor, and save it with an .ahk extention.... then you can just click on the file and the script will run in the background.

the .ahk file can also be compiled into to an .exe file for sharing with people who don't have autohotkey

capellan2000
  • Members
  • 3 posts
  • Last active: Jan 29 2009 10:35 PM
  • Joined: 17 Jan 2009
Hi Anon,

i am new in this forum.
Your script works great. Many thanks for sharing! :D

Now i want to know if it is possible to run
this script in my second monitor (a TV) to
view videos without the gray bar.

Thanks in advance for your answer!
Keep up your smart work!

al

Anon
  • Guests
  • Last active:
  • Joined: --
Hi capellan2000,

I made a few small adjustments to the code, and tested it on a multimonitor setup and it seems to be working for me....

(and hopefully if you use the keys 'a' and 'z' to adjust the bar height then these should be stored as separate values for each monitor ....as the 2nd montior isn't always the same resolution as the first)

Let me know if it works for you
thanks

Blocker_check:= 0
Mon1:= 41  ; size of bar (on primary monitor), adjust if required (seems to be larger in firefox than ie!!!)
Mon2:= 41  ; size of bar if secondary monitor used
Sysget, MonNum, MonitorCount


; check status every 1 second (timer needs to be at top of script)
#Persistent
SetTimer, YT_autohide, 1000
return 


; check if in flash full screen mode
#IfWinActive ahk_class ShockwaveFlashFullScreen

YT_autohide:
  ; hide if idle for 5 seconds....
  if ( ((a_timeidle > 5000 and Blocker_check = 0) or KeepHid = 1) and (WinExist("YouTube") or WinExist("Leave Alluc")) and WinActive("ahk_class ShockwaveFlashFullScreen"))
  {
     WinGetPos, Xp, Yp, Wp,Hp , A
	 if((MonNum > 1) and (Xp > 0) )  ;if theres more than one monitor, and the active window is on the 2nd then...
     {
		 YT1:= Mon2
     }else{
	     YT1:= Mon1
     }	 
	 YT2:= Hp - YT1 
     MouseGetPos,, ypos 
	 if (ypos < YT2)   ;don't hide if mouse over control bar
     {
	   Progress,B CW000000 ZH0 W%Wp% H%YT1% Y%YT2% X%Xp%
       Blocker_check = 1
	   SystemCursor("off")
	 }
	 if (a_timeidle < 5000) 
	 {
	  KeepHid = 0
	 }
  }else if( a_timeidle < 1000 and Blocker_check = 1 and (WinExist("YouTube") or WinExist("Leave Alluc")) and WinActive("ahk_class ShockwaveFlashFullScreen"))  
  {
     Progress, off
     Blocker_check = 0
	 SystemCursor("on")
  }else if( Blocker_check = 1 and WinActive("ahk_class ShockwaveFlashFullScreen") = 0)  ; if something steels focus restore everything...
  {
     Progress, off
     Blocker_check = 0
	 SystemCursor("on")
  }  
return

Esc::
  Progress, Off
  Blocker_check = 0
  SystemCursor("on")
  Send, {Esc}
return

; 'a' and 'z' adjust the height of the bar...
a::
   if((MonNum > 1) and (Xp > 0) )
    {
	  Mon2:= Mon2 + 1
	  YT1:= Mon2
	}else{
	  Mon1:= Mon1 + 1
      YT1:= Mon1
    }
   KeepHid = 1
   WinGetPos, X, Y, Wx,Hx , A
	 YT2:= Hx - YT1 
   Progress,B CW000030 ZH0 W%Wp% H%YT1% Y%YT2% X%Xp%
return

z::
   if((MonNum > 1) and (Xp > 0) )
   {
	  Mon2:= Mon2 - 1
	  YT1:= Mon2
	}else{
	  Mon1:= Mon1 - 1
      YT1:= Mon1
    }
   KeepHid = 1
   WinGetPos, X, Y, Wx,Hx , A
	 YT2:= Hx - YT1 
   Progress,B CW000030 ZH0 W%Wp% H%YT1% Y%YT2% X%Xp%
return

; the following send the keyboard shortcuts used in flash v10, without effecting the autohide
left::
  if (Blocker_check = 1)
 {  
 Send, {left}
 KeepHid = 1
 Progress,B CW000000 ZH0 W%Wp% H%YT1% Y%YT2% X%Xp%
 }else 
    Send, {left}
return

right::
  if (Blocker_check = 1)
 {  
 Send, {right}
 KeepHid = 1
 Progress,B CW000000 ZH0 W%Wp% H%YT1% Y%YT2% X%Xp%
 }else 
    Send, {right}
return

up::
  if (Blocker_check = 1)
 {  
 Send, {up}
 KeepHid = 1
 Progress,B CW000000 ZH0 W%Wp% H%YT1% Y%YT2% X%Xp%
 }else 
    Send, {up}
return

down::
  if (Blocker_check = 1)
 {  
 Send, {down}
 KeepHid = 1
 Progress,B CW000000 ZH0 W%Wp% H%YT1% Y%YT2% X%Xp%
 }else 
    Send, {down}
return

Space::
  if (Blocker_check = 1)
 {  
 Send, {Space}
 KeepHid = 1
 Progress,B CW000000 ZH0 W%Wp% H%YT1% Y%YT2% X%Xp%
 }else 
    Send, {Space}
return

;---the following code hides the mouse cursor... taken from the autohotkey help file, via http://www.autohotkey.com/forum/topic6107.html
;SystemCursor("Toggle")  ; Win+C hotkey to toggle the cursor on and off.
SystemCursor(OnOff=1)   ; INIT = "I","Init"; OFF = 0,"Off"; TOGGLE = -1,"T","Toggle"; ON = others
{
    static AndMask, XorMask, $, h_cursor
        ,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 ; system cursors
        , b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13   ; blank cursors
        , h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13   ; handles of default cursors
    if (OnOff = "Init" or OnOff = "I" or $ = "")       ; init when requested or at first call
    {
        $ = h                                          ; active default cursors
        VarSetCapacity( h_cursor,4444, 1 )
        VarSetCapacity( AndMask, 32*4, 0xFF )
        VarSetCapacity( XorMask, 32*4, 0 )
        system_cursors = 32512,32513,32514,32515,32516,32642,32643,32644,32645,32646,32648,32649,32650
        StringSplit c, system_cursors, `,
        Loop %c0%
        {
            h_cursor   := DllCall( "LoadCursor", "uint",0, "uint",c%A_Index% )
            h%A_Index% := DllCall( "CopyImage",  "uint",h_cursor, "uint",2, "int",0, "int",0, "uint",0 )
            b%A_Index% := DllCall("CreateCursor","uint",0, "int",0, "int",0
                , "int",32, "int",32, "uint",&AndMask, "uint",&XorMask )
        }
    }
    if (OnOff = 0 or OnOff = "Off" or $ = "h" and (OnOff < 0 or OnOff = "Toggle" or OnOff = "T"))
        $ = b  ; use blank cursors
    else
        $ = h  ; use the saved cursors

    Loop %c0%
    {
        h_cursor := DllCall( "CopyImage", "uint",%$%%A_Index%, "uint",2, "int",0, "int",0, "uint",0 )
        DllCall( "SetSystemCursor", "uint",h_cursor, "uint",c%A_Index% )
    }
}


capellan2000
  • Members
  • 3 posts
  • Last active: Jan 29 2009 10:35 PM
  • Joined: 17 Jan 2009
hi,

Sorry for the delay to test this code in my machine. :oops:

When i run this script, a warning appears telling me
that there is an error of
"This line does not contain a recognizable action"
in this line:

if ( ((a_timeidle > 5000 and Blocker_check = 0) or KeepHid = 1) and (WinExist("YouTube") or WinExist("Leave Alluc")) and WinActive("ahk_class ShockwaveFlashFullScreen"))

Look a screenshot of this error message:
<!-- m -->http://aulasdigitale...cript_error.PNG<!-- m -->

Please download and run the file script
that is generating this error from:
<!-- m -->http://aulasdigitale...Tube_script.ahk<!-- m -->

i could not see any obvious error.
Maybe an undeclared variable?

Thanks in advance for your help!

alejandro

rock
  • Guests
  • Last active:
  • Joined: --
awesome. works great. thanks anon

SoggyDog
  • Members
  • 803 posts
  • Last active: Mar 04 2013 06:27 AM
  • Joined: 02 May 2006
Shouldn't someone ask a mod to move this to 'Scripts & Functions'?

BoBo³
  • Guests
  • Last active:
  • Joined: --

Shouldn't someone ask a mod to move this to 'Scripts & Functions'?

Everyone is free to extract and post his/her own final scripts within a separate/own thread in Scripts&Functions. No need for a "mod in action". 8)