My favorites | Sign in
Logo
             
Search
for
Updated Jul 03, 2009 by aavindraa
Labels: Release
0994  

0.99.4

Fixed pause/play delay.

You can use the volume controls without pausing the video

playerCont.addEventListener("click", function(e) {
	var x = player.offsetWidth - e.layerX;
	var y = player.offsetHeight - e.layerY;
	if ((x >= 100 && x <= 125 && y >= 25 && y <= 90) || y <= 25) return;
	togglePlay();
}, false);

Added keyboard shortcuts

document.addEventListener("keydown", function(e) {
	switch(e.keyCode) {
		case 80: togglePlay(); return;
		case 77: player[player.isMuted() ? "unMute" : "mute"](); return;
		case 82: player.seekTo(0, true); return;
		case 69: player.seekTo(player.getDuration(), true); return;
	}
}, false);

Added update feature

function update(resp) {
	GM_xmlhttpRequest({
		url : "http://userscripts.org/scripts/source/31864.user.js?update",
		method : "GET",
		onload : function(a) {
			var latest = a.responseText.match(/\/\/ @version       (\S+)/);
			latest = latest ? latest[1] : false;
			if(!latest) return;
			if (latest != thisVer) {
				if(confirm("There is a new version of YouTube HD Ultimate.\n\nInstall it?"))
				location.href = "http://userscripts.org/scripts/source/31864.user.js";
			} else {
				if(resp)
					alert("There is no new version at this time.");
			}
		}
	});
}

Added auto-update feature (once per day)

var now=new Date().getTime();
if ((GM_getValue("lastCheck"), now) <= (now - 86400000)) {
	GM_setValue("lastCheck", now);
	update(false);
}

Floored margin, as JoeSimmons reported not doing so causes issues

player.style.marginLeft = (window.innerWidth >= 960 ? Math.floor((985 - window.innerWidth) / 2) : "0") + "px"; 

Sign in to add a comment
Hosted by Google Code