Youtube Alternate Video Player

By Yansky Last update Dec 23, 2008 — Installed 25,087 times.

Code Suggestions

in
Subscribe to Code Suggestions 2 posts, 2 voices



Avindra V.G. Scriptwright

The header of this script can be:

var vidID = /v=([^#&]+)/.exec(document.URL)[1],
    fv = document.getElementById("movie_player").getAttribute("flashvars"),
    srcWithT = 'http://'+document.domain+'/get_video?video_id='+vidID+'&t='+/t=([^#&]+)/.exec(fv)[1],
    pD = document.getElementById("watch-player-div");

and instead of document.getElementsByTagName("body"..., you can use:

document.body.appendChild(sGetter);

 
Yansky Script's Author

Thanks for the code. I couldn't get it to work though. The /v=[^#&]+/.exec(document.URL)[1] returns null for me.

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