You are here

function emvideo_ustreamlive_thumbnail in Embedded Media Field 6.3

Same name and namespace in other branches
  1. 6 contrib/emvideo/providers/ustreamlive.inc \emvideo_ustreamlive_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/ustreamlive.inc, line 146

Code

function emvideo_ustreamlive_thumbnail($field, $item, $formatter, $node, $width, $height, $options = array()) {
  $ustreamlive_id = $item['value'];

  // old code to grab thumbnail via api
  //   $request = emvideo_ustreamlive_request('ustreamlive.videos.get_details', array('video_id' => $ustreamlive_id));
  //   $tn = $request['THUMBNAIL_URL'][0];
  // if we have a large thumbnail size, then get the larger version available.
  //   if ($width > 130 || $height > 97) {
  //     $tn = "http://img.ustreamlive.tv/vi/$ustreamlive_id/0.jpg";
  //   } else {
  //     // ustreamlive offers 3 thumbnails. select one randomly.
  //     $rand = rand(0, 2) + 1;
  //     $tn = "http://img.ustreamlive.tv/vi/$ustreamlive_id/$rand.jpg";
  //   }
  return $tn;
}