You are here

function emvideo_yahoomusic_thumbnail in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 contrib/emvideo/providers/yahoomusic.inc \emvideo_yahoomusic_thumbnail()

hook emvideo_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/emvideo/providers/yahoomusic.inc, line 402
This include processes Yahoo Music API media files for use by emfield.module.

Code

function emvideo_yahoomusic_thumbnail($field, $item, $formatter, $node, $width, $height) {
  $yahoomusic_id = $item['value'];
  $locale = _emvideo_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;
}