Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Insert YouTube Channel Feed & Player into any site using JSON
#videogroup {
width: 100%;
iframe {
width: 90%;
padding: 5%;
#myplayer .first iframe {
width: 100%;
padding: 0;
#videolist ul {
margin: 0;
padding: 0;
list-style: none;
#videolist li {
width: 50%;
float: left;
border: none;
position: relative;
#videolist li .entriestitle {
padding: 0 5px;
position: absolute;
display: none;
#videolist li:hover .entriestitle {
display: block;
width: 100%;
background: rgb(119, 25, 51);
border-radius: 10px;
color: #FFF;
padding: 10px;
opacity: .9;
z-index: 100;
right: 0;
<script type="text/javascript">
function listVideos(data) {
var firstOutput="";
var entries = data.feed.entry;
var myOutput = '<ul>';
for (var i=0; i<data.feed.entry.length; i++) {
var entriesID=entries[i].id.$t.substring(38);
var entriesTitle=entries[i].title.$t;
var entriesDescription=entries[i].media$$description.$t;
var entriesThumbnail=entries[i].media$$thumbnail[0].url;
myOutput += '<li><div class="entriestitle">' + entriesTitle + '</div>';
myOutput+='<iframe src="'+entriesID+'?wmode=transparent&amp;HD=0&amp;rel=0&amp;showinfo=0&amp;controls=1&amp;fs=1&amp;autoplay="0" frameborder="0" allowfullscreen></iframe>';
if (i==0) {
firstOutput += '<div class="first">';
firstOutput += '<h2>' + entriesTitle + '</h2>';
firstOutput += '<iframe src="'+entriesID+'?wmode=transparent&amp;HD=0&amp;rel=0&amp;showinfo=0&amp;controls=1&amp;autoplay="0" frameborder="0" allowfullscreen></iframe>';
firstOutput += '<p>' + entriesDescription + '</p>';
firstOutput += '</div>';
document.getElementById('videolist').innerHTML = myOutput;
myOutput +='</ul>';
<div id="videogroup">
<div id="myplayer"></div>
<div id="videolist"></div>
<script type="text/javascript" src=""></script>

planetoftheweb commented Apr 18, 2012

This gist lets you read a YouTube stream of video from a channel and place it on your site as a series of playable thumbnails.

You can include it in a sidebar widget in WordPress pretty easily. Just copy the code, then add a text widget in WordPress and paste the code. You might have to tweak your CSS a bit.

For right now, it will load the latest videos from the com channel that are tagged with my last name "Villalobos". To customize, simply change the name of the channel (right now lynda), how many videos you want (results=). The category is optional. One note is that the category will also work with tags. So if you're looking to view by tag or category, just feed the name under the category id.

Has anyone tried out this Youmax plugin .. shows video feeds for any channel or playlist with subscriptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment