Large

YouTube HD Ultimate

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

720p vs fit to window

in
Subscribe to 720p vs fit to window 13 posts, 6 voices



V@no Scriptwright

As some already reported the new 720p could be too big for some resolutions.
This can be fixed by:
1) detecting the size of the inner-window and reduce the size to fit into it (some mathematic formulas needed)
2) simply fit the video into window.

For the #2 method here is working example:

if(opts.true720p && opts.bigMode && unsafeWindow.isHDAvailable) {
/*
	player.style.width="1280px";
	player.style.height="745px";
	player.style.marginLeft="-160px";
	GM_addStyle("#watch-player-div {padding-left:0px!important}");
*/

	player.style.width="100%";
	player.style.height="100%";
	GM_addStyle("#watch-player-div {padding-left:0px!important; width:100%!important; height:100%!important;}");
	GM_addStyle("#baseDiv {width:100%!important;}"); //removes empty space on left
	GM_addStyle("#watch-this-vid {width:"+(document.documentElement.clientWidth-10)+"px!important;height:"+(document.documentElement.clientHeight-30)+"px!important;}");
}

 
JoeSimmons Scriptwright

Setting the width and height to both 100% might make the video disproportional, you should use max widths and heights to keep it inside.

GM_addStyle("#watch-player-div {padding-left:0!important;max-width:"+window.innerWidth+"!important;max-height:"+window.innerHeight+"!important; }");

 
V@no Scriptwright

The 100% is to fill up the div inner space, the div itself is set to needed size.
Resizing only watch-player-div will cover up menu on right side. ;)

Here is an updated code that fills the entire VISIBLE space inside window and will resize player if window was resized:

if(opts.true720p && opts.bigMode && unsafeWindow.isHDAvailable) {
/*
	player.style.width="1280px";
	player.style.height="745px";
	player.style.marginLeft="-160px";
	GM_addStyle("#watch-player-div {padding-left:0px!important}");
*/

	player.style.width="100%";
	player.style.height="100%";
	GM_addStyle("#watch-player-div {padding-left:0px!important; width:100%!important; height:100%!important;}");
	document.getElementById("baseDiv").style.width = "100%"; //removes empty space on left
	document.getElementById("watch-this-vid").style.width = (window.innerWidth-25)+"px";
	document.getElementById("watch-this-vid").style.height = (window.innerHeight-48)+"px";
	window.addEventListener("resize", function(event) { document.getElementById("watch-this-vid").style.width = (window.innerWidth-25)+"px";document.getElementById("watch-this-vid").style.height = (window.innerHeight-48)+"px";}, false);
}

P.S.
Strange, but in my first tests window.innerHeight didn't work...maybe I didn't spell it correctly..

 
Avindra V.G. Script's Author

vano, sorry i didn't reply to this, i coded a fix a while ago, and it will be in the next version.

i removed "true720p", and put in "snapBack" and "fit"

 
Phantec User

I want 720p mode back, why did you remove it? :(
I have 1920x1080 monitor and 720p mode looks much more better over this fit thing, please add 720p mode back, and let us choose. Thank you.

 
Avindra V.G. Script's Author

oh christ... i'll add it back somehow in the next version.

Does fit not look better? I thought it does... it's the "universal" solution.

 
V@no Scriptwright

Phantec:
The problem is that the true720p was hard coded the sizes, and not everyone have big enough display resolution to fit that size in.
Maybe the best solution would be for Avindra Goolcharan add a few "links" (or dropdown) at the bottom so users can select desired sizes, or make video realizable manually like a window.

P.S.
for some reason "userscript updater" didn't find the update automatically...

 
Assirra User

Hai again, i would request to if you use that fit player to screen option to disable it when the video is only high quality.
The reason is even with high quality most older movies just look bad cause they were not supposed to be watched like that.
Hell, in some videos the only diffrence is the sound quality.
So maybe use both true 720p and fit the player to screen and let ppl choose what they want.
Exept for that, still awesome script and i keep using it to the max xD

 
V@no Scriptwright

I agree, on HQ it doesn't look very nice.

 
Phantec User

Hi again. Right now I'm just adding those lines to every new version:
This, after SnapBack

true720p : new Array("True 720p", GM_getValue("true720p", false), "Leave this on for all HD videos to load as 720p videos-- in 720p. bigMode must be on with this too."),

and that (at the end of script):
if(opts.true720p && opts.bigMode && unsafeWindow.isHDAvailable) {
	player.style.width="1280px";
	player.style.height="745px";
	player.style.marginLeft="-160px";
	GM_addStyle("#watch-player-div {padding-left:0px!important}");
}

It's from 0.98.9 version, could you put this into the script back again? I would be appreciated. Thank you.

P.S. You can disable it for default, I don't care, but is nice to have a choice, you created something really fine and you removed it ;/

 
Assirra User

Thanks a lot Phantec, this is EXACTLY what i needed.

 
Avindra V.G. Script's Author

i will include true720p again.

 
Hamelin User
FirefoxWindows

Can you add in an option to only make the video fit to the window if the video is bigger than the screen width? Also, could you somehow add an option to remove the scroll bar on the side of Firefox (since when it is maximized the display area goes right up to the edge of the screen).

Videos in 720p are exactly my screen width and the scroll bar makes the viewable area a teeny tiny bit too narrow and it adds in a horizontal scroll bar.

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