There's no way to determine the actual aspect ratio of the video via
the YouTube Data API response.
The thumbnails (I'm assuming that's what you mean by preview image?)
for a given video are all in specific dimensions, and those dimensions
are returned in the YouTube Data API response. E.g. from
http://gdata.youtube.com/feeds/api/videos/u1zgFlCw8Aw?v=2&prettyprint=true
you get
<media:thumbnail url='http://i.ytimg.com/vi/u1zgFlCw8Aw/default.jpg'
height='90' width='120' time='00:02:09.500' yt:name='default'/>
<media:thumbnail url='http://i.ytimg.com/vi/u1zgFlCw8Aw/
hqdefault.jpg' height='360' width='480' yt:name='hqdefault'/>
<media:thumbnail url='http://i.ytimg.com/vi/u1zgFlCw8Aw/1.jpg'
height='90' width='120' time='00:01:04.750' yt:name='start'/>
<media:thumbnail url='http://i.ytimg.com/vi/u1zgFlCw8Aw/2.jpg'
height='90' width='120' time='00:02:09.500' yt:name='middle'/>
<media:thumbnail url='http://i.ytimg.com/vi/u1zgFlCw8Aw/3.jpg'
height='90' width='120' time='00:03:14.250' yt:name='end'/>
Cheers,-Jeff Posnick, YouTube API Teamgroups.google.com/group/youtube-
api-gdata | apiblog.youtube.com | @YouTubeDev
On Sep 26, 5:44 am, Dick Verweij <hpverw...@gmail.com> wrote:
> Dear Mr. Posnick,
>
> Thanks for your clear answer. What we need is the aspect ratio of the
> preview image. There is no way to retrieve that based on the id of a clip?
>
> Regards,
--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.
No comments:
Post a Comment