youquery.js
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(function($){
var url, width, height, vars, next;
$.fn.youquery = function(url, width, height){
if(url.split('?')[1] != undefined){
vars = url.split('?')[1].split('&');
for(next=0;next<vars.length;next++){
if(vars[next].split('=')[0] == 'v'){
url = vars[next].split('=')[1];
}
}
}
if(!width){
var width = 640;
}
if(!height){
var height = 390;
}
this.html('<embed width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" src="http://s.ytimg.com/yt/swfbin/watch_as3-vflvXpN6T.swf" flashvars="video_id='+url+'&el=embedded"></embed>');
};
})(jQuery);
var url, width, height, vars, next;
$.fn.youquery = function(url, width, height){
if(url.split('?')[1] != undefined){
vars = url.split('?')[1].split('&');
for(next=0;next<vars.length;next++){
if(vars[next].split('=')[0] == 'v'){
url = vars[next].split('=')[1];
}
}
}
if(!width){
var width = 640;
}
if(!height){
var height = 390;
}
this.html('<embed width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" src="http://s.ytimg.com/yt/swfbin/watch_as3-vflvXpN6T.swf" flashvars="video_id='+url+'&el=embedded"></embed>');
};
})(jQuery);