Large

YouTube HD Ultimate

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

Small request

in
Subscribe to Small request 5 posts, 3 voices



StrawTurkey User

This was just a thought that popped into my mind, and, if it's possible, I could probably go through and change the JavaScript myself, but I'm not all that talented, so it would take a lot of time.

Is there any way to change the color of the bar based on whether you're watching an HD or HQ or standard-quality video? Just wanted to put that out there. It'd be an interesting feature.

Thanks for programming this thing, though. It's one of the better GreaseMonkey plugins I use, and certainly saves a lot of sanity by not having to click to switch qualities or reload.

Take care!

- StrawTurkey

 
Avindra V.G. Script's Author

as far as i know, this isn't part of the youtube api. sorry mate

 
JoeSimmons Scriptwright

There's a fmt=34 too but it's very similar to 35.

 
StrawTurkey User

I guess you'd know better than I would, and I'm not good enough with my "If that, then this," to keep up, but, judging by:

if ((_gel("watch-high-quality-link")||"").offsetHeight)
 changeVideoQuality(2); // use built-in YouTube video settings
else {
  var r=new XMLHttpRequest();
    r.open("GET","/watch?v="+pageVideoId+"&fmt="+toLoad);
    r.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) {
         var movie=_gel("movie_player");
	     movie.setAttribute("flashvars",/fs=1([^;]+)/.exec(this.responseText)[1]+iif(!autoplay,"&autoplay=0")+iif(enablecolors,"&color1=0x"+c1+"&color2=0x"+c2));
	     movie.src=movie.src;  // reload player with newly retrieved data
        }
       };
    r.send("")
}

It seems like there'd be some way where, if you get "200 OK" status or whatever (meaning it's available in the format it's checking on), then it could be one way, and if it's not available in fmt=22... Humm...

It seems like there'd at least be a differentiation of whether you're receiving the highest fmt=22, or if it's resorting to the highest of what's available. And if you can route them to separate "if, then"s, it would be possible to have it be one shade/color in one scenario, and another shade/color in another scenario.

Maybe I'm just looking at that code and interpreting the wrong thing, though.

Edit: Er, wait, I'm using the last version but was looking at the present code. I guess that's the problem. Or a problem.

 
Avindra V.G. Script's Author

hey joe, i'll add 34. But one question, how is it compared to 18? Depending on how it compares to 18, I'll code accordingly. @StrawTurkey, I'm not exactly sure what you mean. But this is what my script does:

  1. If the high quality data is already on the page, it will just call the changeVideoQuality function.
  2. If not, it loops through all the available formats, from highest to lowest, to see if there is a better quality available.
  3. Having found a higher quality version, it will load that one with an xmlhttprequest. The default format to load is 18.

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