Tuesday, 8 September 2009

Code to Fetch Youtube Video's Image (JS)

///
//// functionjo getScreen( url, size )
///{
///alert(url);
//alert(size);
// if(url === null){ return ""; }

// size = (size === null) ? "big" : size;
/ var vid;
// var results;

// results = url.match("[\\?&]v=([^&#]*)");

// vid = ( results === null ) ? url : results[1];

/// if(size == "small"){
/// alert("http://img.youtube.com/vi/"+vid+"/2.jpg");
// return "http://img.youtube.com/vi/"+vid+"/2.jpg";
/// }else {
/// alert("http://img.youtube.com/vi/"+vid+"/0.jpg");
/// return "http://img.youtube.com/vi/"+vid+"/0.jpg";
/// }
// }
//



///// function call /////

////onload="getScreen('http://www.youtube.com/watch?v=-4ce_C2Cako', 'small');"

No comments:

Post a comment