aboutsummaryrefslogtreecommitdiff
path: root/video.field.inc
diff options
context:
space:
mode:
authorHeshan <heshan@heidisoft.com>2011-03-14 16:38:05 +0530
committerHeshan <heshan@heidisoft.com>2011-03-14 16:38:05 +0530
commitfbf8a0a295104d0c4d7060c53c2c51330a355d28 (patch)
tree584966abba340a1c92d4030124c722ad012b216f /video.field.inc
parentc4915a3c5824ab4a539f2c996ec5169bd165e07d (diff)
downloadvideo-fbf8a0a295104d0c4d7060c53c2c51330a355d28.tar.gz
video-fbf8a0a295104d0c4d7060c53c2c51330a355d28.tar.bz2
Added video trnscodig and tested with node on save transcoding
Diffstat (limited to 'video.field.inc')
-rw-r--r--video.field.inc22
1 files changed, 22 insertions, 0 deletions
diff --git a/video.field.inc b/video.field.inc
index d81294c..8e819d9 100644
--- a/video.field.inc
+++ b/video.field.inc
@@ -128,6 +128,13 @@ function video_field_prepare_view($entity_type, $entities, $field, $instances, $
* Implements hook_field_presave().
*/
function video_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
+ // change the theumbnails if default is checked
+ if (!empty($field['settings']['default_video_thumbnail'])) {
+ foreach ($items as $delta => $item) {
+ if ($item['use_default_video_thumb'])
+ $items[$delta]['thumbanail'] = $field['settings']['default_video_thumbnail']['fid'];
+ }
+ }
file_field_presave($entity_type, $entity, $field, $instance, $langcode, $items);
}
@@ -444,4 +451,19 @@ function video_field_formatter_view($entity_type, $entity, $field, $instance, $l
);
}
return $element;
+}
+
+/**
+ * Element specific validation for video thumbnail value.
+ *
+ */
+function video_thumbnail_validate($element, &$form_state) {
+ $fid = $element['#value'];
+ // Make the file permanent and store it in the form.
+ if (!empty($fid)) {
+ $file = file_load($fid);
+ $file->status |= FILE_STATUS_PERMANENT;
+ $file = file_save($file);
+// $element['#value'] = (array) $file;
+ }
} \ No newline at end of file