You are here

function media_vimeo_thumbnail_url in Media: Vimeo 6

The URL to the thumbnail video still for the media.

Parameters

$string $video_code: The Vimeo video ID.

Return value

string The URL to the thumbnail.

1 call to media_vimeo_thumbnail_url()
emvideo_vimeo_thumbnail in includes/providers/emvideo/vimeo.inc
hook emvideo_PROVIDER_thumbnail returns the external url for a thumbnail of a specific video TODO: make the args: ($video_code, $field, $item), with $field/$item provided if we need it, but otherwise simplifying things

File

./media_vimeo.module, line 98
media_vimeo/media_vimeo.module Embedded Video Field provider file for Vimeo.com.

Code

function media_vimeo_thumbnail_url($video_code) {
  $data = media_vimeo_data($video_code);
  if (isset($data['thumbnail_large'])) {
    return $data['thumbnail_large'];
  }
  else {
    if (isset($data['thumbnail_medium'])) {
      return $data['thumbnail_medium'];
    }
  }
  if (isset($data['thumbnail_small'])) {
    return $data['thumbnail_small'];
  }

  // Fallback to oembed.
  $xml = emfield_request_xml('vimeo', 'http://vimeo.com/api/oembed.xml?url=http%3A//vimeo.com/' . $video_code, array(), TRUE, FALSE, $video_code);
  return url($xml['OEMBED']['THUMBNAIL_URL'][0]);
}