of the video thumbnail, video gets played. (Works good for iOS and
Android but not on Black Berry 6).
Code used for the same is given below:
Index.html File:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>TK</title>
<script src="tabs.js" type="text/javascript"></script>
</head>
<body>
<div id="youtubeVideos">
<script type="text/javascript"
src="http://gdata.youtube.com/feeds/users/TeekayCorp/uploads?
alt=json- in-script&callback=showMyVideos">
</script>
</div>
</body>
</html>
tabs.js file:
function showMyVideos(data)
{
var feed = data.feed;
var entries = feed.entry || [];
for (var i = 0; i < entries.length; i++) {
var mediacontentUrl = entries[i].media$group.media$content[0].url;
var queryString = mediacontentUrl.split("?")[0];
var youtubeId = queryString.split('/')[4];
videoId = "http://www.youtube.com/v/" + youtubeId + "?
version=3&autohide=1&showinfo=0";
createVideoObject();
}
}
/*
Function to generate video grid
*/
function createVideoObject()
{
document.write('<OBJECT width = "450" height = "250" style="margin:
20px;">');
document.write('<PARAM name="movie" VALUE="' + videoId + '"></
Param>');
document.write('<EMBED name="movie" src="' + videoId + ' "
type="application/x-shockwave-flash" allowscriptaccess="always"
width="450" height="250"></EMBED>');
document.write('<PARAM name="allowScriptAccess" VALUE="always"></
Param>');
document.write('</OBJECT>');
}
How can I display All videos uploaded to my account in video thumbnail
grid form.
Any Help is Appreciated.
--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.
No comments:
Post a Comment