-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught TypeError: Cannot read property 'contentDetails' of undefined #11
Comments
Can you give example of playlist id, I will try it |
Here's a playlist that I'm using. PLCVojkU9NBJ4YoJxEYu1maHNmJC_tIZHZ I also tested on the demo site to confirm. |
Thanks @DerekBess error happened because it can not read private video. I have fixed it by adding part status to check whether the video is public or private. Sorry if my english is not good. :) |
Hi, @bachors! You need to fix a bit more. If one video is 'This video is not available.' occurs the same critical error and output just a black block. The test playlist is: https://www.youtube.com/playlist?list=PLk6n90VAXJUYJcQR_nnCs1qHn2gwWiCSY , so id: PLk6n90VAXJUYJcQR_nnCs1qHn2gwWiCSY I guess you need to add checking for an empty (deleted etc) video item. I tried this (https://developers.google.com/youtube/v3/docs/videos#status.uploadStatus):
errors gone, but list show only the playlist title. |
I spent some time with your code and this fixes the issue:
But I think better if you will fix it more fully: Skip empty/deleted/corrupted items in the list. |
I continue to get the following errors:
Uncaught TypeError: Cannot read property 'contentDetails' of undefined
var b = a.items[0].contentDetails.duration,
Uncaught TypeError: Cannot read property 'high' of undefined
d += '<div class="play" data-vvv="' + b + '" data-img="' + c.items[i].snippet.thumbnails.high.url + '" title="' + c.items[i].snippet.title + '"><div class="thumb"><img src="' + c.items[i].snippet.thumbnails.default.url + '" alt=" "><span class="tm' + i + '"></span></div>';
The text was updated successfully, but these errors were encountered: