Youtube's Videobar is an outdated widget. Google is still serving the js but the documentation and links have been taken off from their site. You can see a running example of this over at: sicmaui.com (right side, youtube tab)
Its currently being loaded using a script tag on html
<script src="http://www.google.com/uds/api?file=uds.js&v=1.0&source=uds-vbw" type="text/javascript"></script>
GSearch.setOnLoadCallback(somefunction); //works
But it doesn't work when I try to load this using the following code
var $script = $('<script></script>').attr('src', src).bind('load', function(){
GSearch.setOnLoadCallback(somefunction); //GSearch is undefined
});
$('head')[0].appendChild($script[0]);
Now the js is being loaded perfectly fine. But the variable is undefined. I digged into the google's js and found that later on its loading another js file using this code:
google.loader.writeLoadTag("script", google.loader.ServiceBase + "/api/search/1.0/8c68537a8c14de310f268bd7f81c9c67/default+en.I.js", false);
which makes a call (where 'n' equals document)
n.write('<script src="' + b + '" type="text/javascript"><\/script>')
Now ideally this js should overwrite the entire page contents with this script. But for some reason it isn't doing so and this is driving me nuts!
Either way, my primary goal is to load this file asynchronously.