I am trying to retrieve a particular playlist thumbnail of user but here I stuck - it is not getting the views and description of the video. I want to allow the video within my website only.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.3.js'></script>
<script type='text/javascript'>//<![CDATA[
$(window).load(function() {
function LoadVids(startindex) {
if (typeof startindex === "undefined" || startindex === null) startindex = 1;
var playListURL = 'http://gdata.youtube.com/feeds/api/playlists/PL3B8939169E1256C0?orderby=published&v=2&alt=json&&start-index=' + startindex;
var videoURL = 'http://www.youtube.com/watch?v=';
$.getJSON(playListURL, function(data) {
var list_data = "";
$.each(data.feed.entry, function(i, item) {
var feedTitle = item.title.$t;
var feedURL = item.link[1].href;
var fragments = feedURL.split("/");
var videoID = fragments[fragments.length - 2];
var vid = item.media$group.yt$videoid.$t;
var url = videoURL + videoID;
var vidtitle = item.title.$t;
var thumb = "http://img.youtube.com/vi/" + videoID + "/default.jpg";
list_data += ' < img alt = "'+ feedTitle+'"
src = "'+ thumb +'"
' + ' - ' + vidtitle + '
';
});
$(list_data).appendTo(".cont");
});
}
//
$(document).ready(function() {
LoadVids(1); // call on load more click
});
}); //
</script>
</head>
<body>
</body>
</html>