My favorites | Sign in
Logo
             
Search
for
Updated Aug 26, 2009 by aavindraa
Labels: Release
v112  

1.1.2

Features Added

Dynamic control of looping feature

The css:

.loop {\
	width: 28px;\
	height: 13px;\
}\
.loop.on {\
	background-image: url(super long data:uri);\
}\
.loop.off {\
	background-image: url(super long data:uri);\
}\

and the code:

head.appendChild(new Element("span", {
	className : "loop o" + (opts.loop ? "n" : "ff"),
	style : "padding-left:2px;padding-right:2px;",
	onclick : function() {
		GM_setValue("loop", opts.loop = !opts.loop);
		this.className = "loop o" + (opts.loop ? "n" : "ff");
	}
}));

REQ: Volume Control

Added GUI control of this feature:

	useVol : new Array("Enabled Fixed Volume", false, "This will enabled the fixed volume feature (script sets volume to custom amount at the start of every video)."),
	vol : new Array("Volume", "50", "The volume, as an integer, from 0 to 100.")

and then the actual code (inside the initializer):

	if(opts.useVol && opts.vol.match(/(\d+)/))
		player.setVolume(RegExp.$1);

Issues Fixed

Use of "WMODE" makes everything pretty, but causes too many problems

Removed wmode, and make the player invisible + paused when using configuration instead. Hooray.

Assuming there is a YouTube UI update that breaks script, script WILL NOT update

Now, the script will never break before checking for an update, since the code is moved up to the top.

Options box is beginning to look too warped

Massively changed a lot of css / html code to make it more presentable. Removed conflicting colors (red/blue) that bothered JoeSimmons.

Most people don't know this script is hosted on Google Code!

I added a TON of links to the GUI, making this impossible to miss now.

var sLinks = {
	"homepage" : "http://userscripts.org/scripts/show/31864",
	"official" : "http://code.google.com/p/youtubehd/",
	"author" : "http://userscripts.org/users/avindra",
	"e-mail" : "mailto:aavindraa@gmail.com",
	"forums" : "http://userscripts.org/scripts/discuss/31864",
	"wiki / F1" : "http://code.google.com/p/youtubehd/wiki/mainPage",
	"open bugs and requests" : "http://code.google.com/p/youtubehd/issues/list",
	"all bugs and requests" : "http://code.google.com/p/youtubehd/issues/list?can=1",
	"new bug" : "http://code.google.com/p/youtubehd/issues/entry",
	"new request" : "http://code.google.com/p/youtubehd/issues/entry?template=Feature%20Request"
};

Script doesn't load best quality if fmt=18 is supplied as a parameter

This takes care of it (deja vu, could've sworn I already did this):

	if(swfArgs.fmt_map.indexOf("18")==0 && /3[45]/.test(swfArgs.fmt_map))
		swfArgs.fmt_map=swfArgs.fmt_map.replace(/18.+?,/,"");

Clicking on dark shade doesn't toggle it (as it does in YouTube's native version)

Mass code re-write:

var shade, tog;
function toggle() {
	if (document.body.className.indexOf("watch-lights-off") != -1) {
		tog.className=tog.className.replace("dark", "light");
		shade.style.display = "none";
		document.body.className = document.body.className.replace("watch-lights-off", "");
	} else {
		tog.className=tog.className.replace("light", "dark");
		shade.style.display = "inline";
		shade.style.height = document.body.offsetHeight + "px";
		document.body.className += " watch-lights-off";
	}
}
if(!unsafeWindow.toggleLights) {
	if(opts.autoCinema)
		document.body.className += " watch-lights-off";
	document.body.appendChild(shade=new Element("div", {onclick : toggle, id : "watch-longform-shade", style : "height : "+document.body.offsetHeight + "px; display : " + (opts.autoCinema ? "" : "none")}));
	head.appendChild(tog=new Element("span", {
			id : "light-switch",
			className : "master-sprite " + (opts.autoCinema ? "dark" : "light"),
			onclick : toggle
	}));
}

Notes

I have removed E4X so that Google Chrome does not reject it. However, Chrome still has issues with preferences, so it will not work in Chrome yet.


Sign in to add a comment
Hosted by Google Code