从Vimeo获取img缩略图? [英] Get img thumbnails from Vimeo?
问题描述
从Youtube获取图片时,我只是这样做:
http://img.youtube.com/vi/HwP5NG-3e8I/2.jpg
任何想法如何为Vimeo做?
以下是相同的问题,没有任何答案。
制作视频请求
要获取有关特定视频的数据, b使用以下网址:
http://vimeo.com/api/v2/video/video_id.output
video_id 视频ID想要的信息。
输出指定
输出类型。我们目前提供JSON,
PHP和XML格式。
因此,获取此网址 http://vimeo.com/api/v2/video/6271487.xml
< videos>
< video>
[已跳过]
< thumbnail_small> http://ts.vimeo.com.s3.amazonaws.com/235/662/23566238_100.jpg< / thumbnail_small>
< thumbnail_medium> http://ts.vimeo.com.s3.amazonaws.com/235/662/23566238_200.jpg< / thumbnail_medium>
< thumbnail_large> http://ts.vimeo.com.s3.amazonaws.com/235/662/23566238_640.jpg< / thumbnail_large>
[已跳过]
< /影片>
对每个视频进行解析以获取缩略图
这里是PHP中的近似代码
<?php
$ imgid = 6271487;
$ hash = unserialize(file_get_contents(http://vimeo.com/api/v2/video/$imgid.php));
echo $ hash [0] ['thumbnail_medium'];
I want to get a thumbnail image for videos from Vimeo.
When getting images from Youtube I just do like this:
http://img.youtube.com/vi/HwP5NG-3e8I/2.jpg
Any idea how to do for Vimeo?
Here is same question, without any answer.
From the Vimeo Simple API docs:
Making a Video Request
To get data about a specific video, use the following url:
http://vimeo.com/api/v2/video/video_id.output
video_id The ID of the video you want information for.
output Specify the output type. We currently offer JSON, PHP, and XML formats.
So getting this URL http://vimeo.com/api/v2/video/6271487.xml
<videos>
<video>
[skipped]
<thumbnail_small>http://ts.vimeo.com.s3.amazonaws.com/235/662/23566238_100.jpg</thumbnail_small>
<thumbnail_medium>http://ts.vimeo.com.s3.amazonaws.com/235/662/23566238_200.jpg</thumbnail_medium>
<thumbnail_large>http://ts.vimeo.com.s3.amazonaws.com/235/662/23566238_640.jpg</thumbnail_large>
[skipped]
</videos>
Parse this for every video to get the thumbnail
Here's approximate code in PHP
<?php
$imgid = 6271487;
$hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$imgid.php"));
echo $hash[0]['thumbnail_medium'];
这篇关于从Vimeo获取img缩略图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!