Is it possible to get the latest YouTube video thumbnail from my channel? I just want to show 5 latest YouTube video thumbnails on my website, then play the video in a pop up when I click on it.
Show 5 latest YouTube video thumbnail in my website
Is it possible to get the latest YouTube video thumbnail from my channel? I just want to show 5 latest YouTube video thumbnails on my website, then play the video in a pop up when I click on it.
Show 5 latest YouTube video thumbnail in my website
$channelid=""; //write the channel id in quotes
$xml = simplexml_load_file(sprintf('https://www.youtube.com/feeds/videos.xml?channel_id=%s', $channelid));
$id = $xml->entry[0]->children('yt', true)->videoId[0]; //First Video ID
$id2 = $xml->entry[0]->children('yt', true)->videoId[1]; //Second Video ID-Duplicate this up to 5
$thumbimg="http://img.youtube.com/vi/$id/maxresdefault.jpg"; //First Video's thumnail
$thumbimg2="http://img.youtube.com/vi/$id2/maxresdefault.jpg"; //Second Video's thumnail-Duplicate this up to 5