jakiestfu / Youtube-TV

A small, slick, library independent YouTube User/Playlist player
https://github.com/jakiestfu/Youtube-TV#demos
205 stars 125 forks source link

Channel doesn't work #10

Open polikin opened 11 years ago

polikin commented 11 years ago

I have this error and I don't know why..

TypeError: video.stats is undefined

window.onload = function(){

    window.controller = new YTV('frame', {
        user: 'LesJeuxduQuebec',
        accent: '#008D54',
        browsePlaylists: true,
        controls: false,
        autoplay: true
    });

};
mMoovs commented 11 years ago

I just noticed the same error.

I made a quick fix and just replaced the part where video.stats is added to the output string. It's at the line 229 in the ytv.js file.

So I replaced this line:

list +='<div class="ytv-content"><b>'+(video.title)+'</b><span class="ytv-views">'+utils.addCommas(video.stats.viewCount)+' Views</span></div>';

With this:

list +='<div class="ytv-content"><b>'+(video.title)+'</b><span class="ytv-views"></span></div>';

It really is a quick fix because I don't have the time to find the real reason now. The viewcount is not very important feature to me but I would still be nice to have it there. So I'll be waiting for someone with the time to make a real fix!