function video_google_v_auto_thumbnail in Video 6
Same name and namespace in other branches
- 5 types/video_google/video_google.module \video_google_v_auto_thumbnail()
- 6.2 types/video_google/video_google.module \video_google_v_auto_thumbnail()
Implementation of hook_v_auto_thumbnail
File
- types/
video_google/ video_google.module, line 136 - Enable Google Video support for video module.
Code
function video_google_v_auto_thumbnail($node) {
if (count($_POST)) {
if ($_POST['vidfile'] == $node->vidfile) {
_video_image_thumbnail_debug(t('No new video to thumbnail'));
return NULL;
}
if ($_POST['tempimage']['fids']['_original']) {
_video_image_thumbnail_debug(t('Video already thumbnailed'));
return NULL;
}
}
// let's include apiclient logic
//get the video id
if (!$node->vidfile && count($_POST)) {
$vidfile = $_POST['vidfile'];
}
else {
$vidfile = $node->vidfile;
}
$id = _video_google_get_id($vidfile);
// get thumbnail url
$thumbnail_url = _video_apiclient_google_get_thumbnail_url($id);
return _video_image_get_thumb_file_object($thumbnail_url, $id);
}