"Hack" for HD Streams / new widescreen layout
|
|
Im calling this a "hack" as it was a quick and unauthorized addition that was tested to the point where it works for me. See below for newer, more complete uploaded version I got bored over the weekend and added some code for switching to High Qualith Streams. It required two sections: Section 1 in the header between scrWithT and pDvar quallink = '<a style="text-decoration:none" href="'+document.location.toString()+'&fmt=18">Watch in High Quality</a>';
var qual = 'Regular';
if (document.location.toString().indexOf("fmt=18") != -1){
qual = 'High';
quallink = '<a style="text-decoration:none" href="'+document.location.toString().split("&fmt=",1) +'">Watch in Regular Quality</a>';
srcWithT = 'http://'+document.domain+'/get_video?fmt=18&video_id='+vidID+'&t='+fv.split("&t=")[1].split("&")[0];
} Section 2 is in the <br><div width="480"><div style="float:left;">Playing '+ qual +' Quality</div>'+ '<div style="float:right;" align="right">'+quallink+'</div><div style="clear: both;"></div></div> Let me know what you think. It really was just a quick hack but if you want some help then I can help refine it. |
|
|
Well Im back at it. These changes might reflect for me only. Please let me know if you are seeing the new formats. See below for newer, more complete uploaded version 1) Change the width = 480 to 640 and it will stretch out flowplayer.
2) Change
3) Youtube moved the quality link out and it will appear annoyingly at times. Add the following to hide it everytime. var ytQualLink = document.getElementById('watch-video-quality-setting');Then after the pD.innerHTML section add this
if (ytQualLink) {
ytQualLink.parentNode.removeChild(ytQualLink);
}
|
|
|
Still at it. See below for newer, more complete uploaded version Now that the widescreen has been enabled the format 22 (HD Streams) can be hacked in. Section 1 in the header between scrWithT and pD now becomes more complex to:
var quallink = 'Switch to: <a style="text-decoration:none" href="'+document.location.toString()+'&fmt=18">High Quality</a>/ This will let you switch back and forth between Standard/High/HD. And the new format 22 HD looks amazing but eats your system resources like crazy. |
|
|
I can't get the code to work. My editor seems to be confused about the syntax when I put it in the corresponding spots. I don't know if you could possibly email me the .js or something? |
|
|
Newer, more complete uploaded version Try this link: Tecker Modified Version V1.0tm4 (http://hockersmith.net/FirefoxHacking/youtube_a...) I just threw this up on my website. Let me know if it works for you. |
|
|
[edit, the code that was posted here was incomplete so I'm retracting it. See below for explanation.] The uploaded file linked above has been HEAVILY modified. I have made a default format ability and to track when you have switched from the default to what ever else you picked. The number of changes are enormous (Yansky if you need help understanding let me know) so I will not list them here. I have finally reached a point where it behaves as I want it to. Expected Behavior:
FIXED. See below. Please test and let me know what happens. Thanks. |
|
|
Fixed the caveat. Version 1.0tm4 (Tecker Mod 4) has been uploaded. See above for new version. In fixing the code I was able to clean it up a little as well and make it a little less complex. Now the handling of the default is all interal to the script and does not require you to refresh the page. This should make back and page navigation easier. |
|
|
Thanks Tecker, I'm trying this out. Can I ask, can I simply replace the code exactly as suggested by Yansky in another thread, to revert the player in your revised code to the old player? I like the way you've made/kept the default playback quality as non-HQ (I think you have anyway). My old Pentium III struggles with streaming normal Flash at the best of times, let alone high quality clips.
Lee
|
|
|
Firefox update 3.0.5 breaks this nice script ? at least on my pc
|
|
|
Interesting. Im noticing that exact same behavior as you mentioned. I will see what I can find but this may be related to an XSS bug fix and may stem from either a problem in greasemonkey or the way we are doing the script. |
|
|
[note: Script broken in 3.0.5. Am looking for workaround.] FOUND IT.
http://www.mozilla.org/security/announce/2008/m... states that due to the XMLHttpRequest vulnerability they implemented the following workaround:
Way to go fellas. Coulda let some of us who USE that function know that you were going to get rid of it. Thanks. I will see if there is a greasemonkey call that we can make to fix this. |
|
|
@ tecker
Feel free to make a new userscript with your HD version. I personally am logged into youtube most of the time, so I almost always have "HD" enabled in my youtube settings, but I realise a lot of people don't do it that way so if you create a new userscript, I will put a link to it on this scripts page. BTW, all my scripts are released with a CC license, so you can do just about anything you want with them. :)
|
|
|
I had stumbled upon that last night. I think that you should use this as a stop gap only. Here's why: GM_XMLHttpRequest will actually download the full video when called the way you have it implemented (onload). The standard XMLHttpRequest could be polled in the middle to check to see when youtube passed us off and then just grab the new URL and run. GM_XMLHttpRequest does not have a reliable way of doing this. Trying to catch it mid request (onstatechange) will cause really bad script hangs and processor loads. Currently the video will download 2 times. First time to get just the URL the second time to actually load the video into FlowPlayer. I think that we should watch the changelogs to see when this is fixed (3.1 maybe?) as I prefer the old method. Or greasemonkey could just fix the dang bug. Your code on this version however is nicely minimal. |
|
|
Try it now. |
|
|
Woah wait a tick. How did you pull that off? I could have sworn I had tried that but it didnt load. Hmmm. Maybe I didnt trigger it correctly. [edit] Hmmmmm... I didnt encode the string though. I was just pulling the srcWithT variable not a URIecnoded version. Good revisit. This restores the script once again to my active status. Oh and yet again you simplified the code. I honestly dont think this is going to get any simpler. (you might surprise me though.) [/edit] |