Youtube API获取视频获取播放列表的持续时间

时间:2016-03-15 16:39:07

标签: video youtube

我正在尝试从playlistId获取视频详情。虽然我能够详细检索所有视频的详细信息,但我缺少视频时长,即使API文档中描述,我也缺少开始时间和结束时间。

我的请求网址就像。

https://www.googleapis.com/youtube/v3/playlistItems?key={MYAPIKEY}&part=id%2CcontentDetails%2Csnippet&playlistId=UUZSp2txrkbx8U8T2jM8qBNA&maxResults=50

回应是 -

[ { kind: 'youtube#playlistItem',
etag: '"q5k97EMVGxODeKcDgp8gnMu79wM/qP8_ts1MTC2182AbfAh627bqqr4"',
id: 'UUREkNLQPHs-SSZYauOziXi0gAPODGW1Xc',
snippet: 
 { publishedAt: '2012-01-11T08:20:29.000Z',
   channelId: 'UCZSp2txrkbx8U8T2jM8qBNA',
   title: 'VIDEO TITLE HERE',
   description: '',
   thumbnails: [Object],
   channelTitle: 'XXX',
   playlistId: 'UUZSp2txrkbx8U8T2jM8qBNA',
   position: 0,
   resourceId: [Object] },
contentDetails: { videoId: 'jDcKLVcbRLI' // It is mentioned that I would receive video start and end time in detail. So I could calculate its playtime. } } ]

我错过了参数或我错了?

0 个答案:

没有答案