Getting the Vimeo video thumb
Posted: Mon Jul 30, 2012 2:54 am
UDT
Makes the full path to the video, put in an image tag. I'm using this to just input an id in a custom field in the CGBlog so that it gets the thumb for the summary page and the video for the detail page, see it at my blog dropsoul(dot)com/blog.html the post titled "testing thumb UDT for vimeo" which is on the first page for now.
Code: Select all
/**
* Gets a vimeo thumbnail url
* @param mixed $id A vimeo id (ie. 1185346)
* @return thumbnail's url
* http://stackoverflow.com/a/10503411
* usage: {vimeothumb id='1185346'}
*/
$id = $params['id'];
$data = file_get_contents("http://vimeo.com/api/v2/video/$id.json");
$data = json_decode($data);
return $data[0]->thumbnail_large;
Code: Select all
usage: {vimeothumb id='1185346'}