ttmt ttmt - 1 year ago 76
PHP Question

Vimeo thumbnail larger than 640px

I'm using code similar to this to add thumbnails of vimeo videos to a page.


if(defined('AT_PROXY')) {
$aContext = array(
'http' => array(
'proxy' => AT_PROXY,
'request_fulluri' => true,
$cxContext = stream_context_create($aContext);

$contents = file_get_contents(''.$main_video.'.php', False, $cxContext);
} else {
$contents = file_get_contents(''.$main_video.'.php');

$main_video = 9700052;

$contents = file_get_contents(''.$main_video.'.php');

$array = @unserialize(trim($contents));
$video_thumbnail = str_replace('http://', 'https://',$array[0]["thumbnail_large"]);

<div class="video_thumbnail text-center">

<img src="<?php echo $video_thumbnail ?>" alt="" class="img-responsive" />

<div class="play js-play" data-vid="<?php echo $main_video; ?>">
<span class="glyphicon glyphicon-play play-btn"></span>


I'm using Javascript to play the movie when the js-play button is clicked.

My problem is the size of the thumbnail, the large size is 640px but I would like it slightly larger.

Is it possible to get the vimeo thumbnail at a larger size.

Answer Source

If the biggest size Vimeo gives is 640px you can resize the image with CSS.

 <img src="<?php echo $video_thumbnail ?>" alt="" class="img-responsive video-thumbnail" />


.video_thumbnail {
  width: 760px;
  height: 450px;