Need a fresh pair of eyes on this code. Everything looks correct to me, but it's not functioning as expected. The entries are results from a search.
function displayVideos(data) {
var feed = data.feed;
var entries = feed.entry || [];
var html = ['<ul>'];
for (var i = 0; i < entries.length; i++) {
var entry = entries[i];
var playCount = entry.yt$statistics.viewCount.valueOf() + ' views';
var title = entry.title.$t;
var lnk = '<a href="' + entry.link[0].href + '">link</a>';
var entPar = objToString(entry.id);
var parseEntries = entPar.split("/");
var videoID = parseEntries[5].substring(0,11)
var params = { allowScriptAccess: "always" };
var atts = { id: "ytPlayer" };
// SWFObject handles the embedding
swfobject.embedSWF("http://www.youtube.com/v/" + videoID + "?version=3&enablejsapi=1&playerapiid=player1", "videoDiv", "480", "295", "9", null, null, params, atts);
html.push('<li>', title, ', ', playCount, ', ', lnk, '</li>');
}
html.push('</ul>');
document.getElementById('videoResultsDiv').innerHTML = html.join('');
}