Url Fmt
|
|
A better way to get the url fmt is this
var urlfmt = fullURL.split("&fmt=")[1].split("&")[0];
And when you have a long row of getElementById's, you should use with() so you don't have to access document all those times... example:
with(document) {
getElementById("baseDiv").style.width = "1300px";
getElementById("masthead").style.width = "1300px";
getElementById("watch-player-div").style.padding = "0px 0px 0px 10px";
getElementById("watch-this-vid").style.height = "748px";
getElementById("watch-this-vid").style.width = "1280px";
getElementById("watch-player-div").style.height = "748px";
getElementById("watch-player-div").style.width = "1280px";
getElementById("watch-this-vid-info").style.width = "800px";
getElementById("watch-this-vid-info").style.marginTop = "10px";
getElementById("watch-other-vids").style.width = "450px";
getElementById("watch-other-vids").style.marginTop = "30px";
getElementById("movie_player").style.height = "748px";
getElementById("movie_player").style.width = "1280px";
}
|
|
|
Ah nice, that with() is new knowledge for me :P. First time I've seen that one in 2 years that I'm working with javascript and such. I'll be updating that urlfmt though, was kinda a bit lazy to split() it out :P |
|
|
Would be difficult for it to honer the time code entry in the URL? Example URL: http://www.youtube.com/watch?v=wUPcimeiqLE#t=0m46s When it switches to the HD version it does not pass the time marker. |