Large

YouTube HD Ultimate

By Avindra V.G. Last update Dec 10, 2010 — Installed 402,073 times.

Suggestion: Jump to youtube player

in
Subscribe to Suggestion: Jump to youtube player 7 posts, 5 voices



JoeJoeX User

I really like your script. But I think, it would be a good idea to add a new feature. If jumpToPlayer is true the browser jumps directly to the youtube player, so that you can see the title and the whole Player on 1024x768. I used location.replace, so the history is not broken and you can go back to the previous page with the back button.

Here's the code. Do, whatever you want with it. :-)

Line 24:

	jumpToPlayer=true;

Line 34:

	if(jumpToPlayer)
		window.location.replace(window.location.href.replace(window.location.hash, "") + "#watch-vid-title");

 
cycyrus User

i don't understand how it works@@

 
Cylet User

I was first confused with that option like cycyrus^^. But now I understand that this option scrolls the browser window a little bit downwards automatically, so the player is not partly hidden. But this feature is just usefull with resolutions of 1024x768 and less. Higher resolutions will show the player completely without scrolling...^^

 
Avindra V.G. Script's Author

Actually, its helpful for me too (I have 1280 x 800 res).

 
JoeJoeX User

@Cylet:
It isn't that useful with a very high resolution, but it won't bring you any disadvantages as there is nothing interesting above the video. And you can turn this thing off.

 
Avindra V.G. Script's Author

for anyone reading this:

location.hash has a setter, so for example,

if(jumpToPlayer)  
location.hash="#watch-vid-title";

instead of :

if(jumpToPlayer)  
window.location.replace(window.location.href.replace(window.location.hash, "") + "#watch-vid-title");  

 
V@no Scriptwright

Personally I don't like see an extra long-@$$ crap added into url, so I prefer use this instead:

if(opts.jumpToPlayer)
  document.getElementById('watch-vid-title').scrollIntoView(true);

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel