aboutsummaryrefslogtreecommitdiff
path: root/types/uploadfield/uploadfield_thumb.inc
diff options
context:
space:
mode:
Diffstat (limited to 'types/uploadfield/uploadfield_thumb.inc')
-rw-r--r--types/uploadfield/uploadfield_thumb.inc47
1 files changed, 0 insertions, 47 deletions
diff --git a/types/uploadfield/uploadfield_thumb.inc b/types/uploadfield/uploadfield_thumb.inc
deleted file mode 100644
index 74aeb80..0000000
--- a/types/uploadfield/uploadfield_thumb.inc
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-//$Id$
-
-/**
- * @file
- * Enable image support for video module.
- *
- * @author Heshan Wanigasooriya <heshan at heidisoft dot com, heshanmw at gmail dot com>
- */
-
-function video_auto_thumb_process (&$element) {
-//developed for ffmpeg support
- $file = $element['#value'];
-// $field = content_fields($element['#field_name'], $element['#type_name']);
- if (isset($element['preview']) && $file['fid'] != 0) {
- // TODO : change this to use any transcode to generate thumbnails
- $transcoder = variable_get('vid_convertor', 'ffmpeg');
- module_load_include('inc', 'video', '/plugins/' . $transcoder);
- $function = variable_get('vid_convertor', 'ffmpeg') . '_auto_thumbnail';
- if (function_exists($function)) {
- // $thumbs = ffmpeg_auto_thumbnail($file);
- $thumbs = $function($file);
- }
- else {
- drupal_set_message(t('Transcoder not configured properly'), 'error');
- }
- $default_thumb = '';
- $rnd_img = rand(1, variable_get('no_of_video_thumbs', 5));
- $default_thumb = $thumbs[$rnd_img]->filepath;
-
- if(is_array($thumbs)) {
- foreach($thumbs as $fid => $img) {
- $thumbss[$img->filepath] = theme('uploadfield_image', $img, '', '', array('width' => '50'), FALSE);
- }
- }
- }
-
- $element['data']['video_thumb'] = array(
- '#type' => 'radios',
- '#title' => t('Video Thumbnails'),
- '#options' => $thumbss,
- '#default_value' => !empty($file['data']['video_thumb']) ? $file['data']['video_thumb'] : $default_thumb,
- // '#description' => t('Pleaes choose a thumbnail from above'),
- '#weight' => 10,
- '#attributes' => array('class' => 'video-thumbnails'),
- );
- } \ No newline at end of file