Youtube api v3 duration

305 Views Asked by At

I have problem getting duration from json. I defined item.contentDetails.duration but doesn't work every time (Error says undefined). I don't know what is bad.

FIDDLE

1

There are 1 best solutions below

0
On BEST ANSWER

https://www.googleapis.com/youtube/v3/playlistItems only responses contentDetails with videoId, so you cannot retrieve the duration attribute.

In your example, check again with this json