function emvideo_youtube_thumbnail in Media: YouTube 6
hook emvideo_PROVIDER_thumbnail returns the external url for a thumbnail of a specific video TODO: make the args: ($video_id, $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
- providers/
emvideo/ youtube.inc, line 177 - This include processes youtube.com media files for use by emfield.module.
Code
function emvideo_youtube_thumbnail($field, $item, $formatter, $node, $width, $height, $options = array()) {
if (isset($item['data']['thumbnail']['url'])) {
return $item['data']['thumbnail']['url'];
}
// Always return the larger image, since we're storing images locally.
$proto = _media_youtube_protocol();
$tn = $proto . "img.youtube.com/vi/{$item['value']}/0.jpg";
return $tn;
}