You are here

function emvideo_lastfm_thumbnail in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 contrib/emvideo/providers/lastfm.inc \emvideo_lastfm_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/lastfm.inc, line 115
Provide support for Last.fm to the emfield.module.

Code

function emvideo_lastfm_thumbnail($field, $item, $formatter, $node, $width, $height) {
  $lastfm_id = $item['value'];

  // if we have a large thumbnail size, then get the larger version available.
  if ($width >= 320) {
    $tn = "http://userserve-ak.last.fm/serve/image:320/{$lastfm_id}.jpg";
  }
  else {
    $tn = "http://userserve-ak.last.fm/serve/image:160/{$lastfm_id}.jpg";
  }
  return $tn;
}