API


To get youtube video time duration from url it need video id function getYoutubeDuration($videoid) {      $xml = simplexml_load_file(‘https://gdata.youtube.com/feeds/api/videos/’ . $videoid . ‘?v=2’);      $result = $xml->xpath(‘//yt:duration[@seconds]’);      $total_seconds = (int) $result[0]->attributes()->seconds;       return $total_seconds;} //now call this pretty function. As parameter I gave a […]

Get youtube video time duration from url