Get Youtube/Vimeo Video Detail With the use Of XML Object

//Contact Me : munirsunni@gmail.com
function fetchVideoXMLInfo($video_id, $site, $custom_settings) {

// $video_id = video id which you want to feed
// $site = type of video means youtube or vimeo
// $custom_settings = 0
if ($site == ‘vimeo’) {
$xmlObj = new DOMDocument();
$xmlObj->load(“http://vimeo.com/api/v2/video/$video_id.xml”);
$vimeo = new stdClass;
$vimeo->video_id = $video_id;
$vimeo->site = $site;
$vimeo->plays = $xmlObj->getElementsByTagName(“stats_number_of_plays”)->item(0)->nodeValue;

Continue reading