You are here

function video_cck_yahoomusic_thumbnail in Embedded Media Field 5

hook video_cck_PROVIDER_thumbnail returns the external url for a thumbnail of a specific video TODO: make the args: ($embed, $field, $item), with $field/$item provided if we need it, but otherwise simplifying things

Parameters

$field: the field of the requesting node @param $item the actual content of the field from the requesting node @return a URL pointing to the thumbnail

File

contrib/video_cck/providers/yahoomusic.inc, line 398
This include processes Yahoo Music API media files for use by emfield.module.

Code

function video_cck_yahoomusic_thumbnail($field, $item, $formatter, $node, $width, $height) {
  $yahoomusic_id = $item['value'];
  $locale = _video_cck_yahoomusic_locale_lookup();
  $tn = "http://d.yimg.com/img.music.yahoo.com/image/v1/video/{$yahoomusic_id};encoding=jpg;size=" . $width . 'x' . $height . ";locale={$locale};";

  // if we have a large thumbnail size, then get the largest version available.
  if ($width > 385 || $height > 231) {
    $tn = "http://d.yimg.com/img.music.yahoo.com/image/v1/video/{$yahoomusic_id};encoding=jpg;locale={$locale};";
  }
  return $tn;
}