function video_cck_veoh_thumbnail in Embedded Media Field 5
File
- contrib/video_cck/providers/veoh.inc, line 82
Code
function video_cck_veoh_thumbnail($field, $item, $formatter, $node, $width, $height) {
$thumbid = $item['value'];
$thumbnail = 'http://p-images.veoh.com/thumb.out?imageId=thumb-' . $thumbid . '-' . rand(0, 30) . '.jpg';
if (video_cck_veoh_check_thumbnail($thumbnail) != NULL) {
return $thumbnail;
}
else {
$url = 'http://www.veoh.com/rest/video/' . $thumbid . '/details';
$content = file_get_contents($url);
if ($content) {
print '(start)<br>';
print $content;
print '(end)<br>';
$start = strpos($content, 'fullMedResImagePath="') + 21;
$end = strpos($content, '"', $start);
$thumbnail = substr($content, $start, $end - $start);
}
return $thumbnail;
}
}