diff options
author | Heshan <heshan@heidisoft.com> | 2011-03-13 00:03:05 +0530 |
---|---|---|
committer | Heshan <heshan@heidisoft.com> | 2011-03-13 00:03:05 +0530 |
commit | f53f62a5ecf8343941e2c74d06b429bb271d7df2 (patch) | |
tree | 788ce5cb10e20aa104b2b9975a0b07304fef63b5 /includes | |
parent | d47e35b2a2c56ecbfc813433d96082394f98136b (diff) | |
download | video-f53f62a5ecf8343941e2c74d06b429bb271d7df2.tar.gz video-f53f62a5ecf8343941e2c74d06b429bb271d7df2.tar.bz2 |
Completed some transcoding stuff and tested the video convert on save.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/conversion.inc | 4 | ||||
-rw-r--r-- | includes/preset.inc | 11 | ||||
-rw-r--r-- | includes/transcoder.inc | 23 |
3 files changed, 14 insertions, 24 deletions
diff --git a/includes/conversion.inc b/includes/conversion.inc index b9be2b4..6611e06 100644 --- a/includes/conversion.inc +++ b/includes/conversion.inc @@ -93,10 +93,6 @@ class video_conversion { return $this->transcoder->create_job($video, $nid); } - public function update_job($video) { - return $this->transcoder->update_job($video); - } - public function delete_job($video) { return $this->transcoder->delete_job($video); } diff --git a/includes/preset.inc b/includes/preset.inc index f1c14b8..d3a3fdd 100644 --- a/includes/preset.inc +++ b/includes/preset.inc @@ -36,7 +36,7 @@ class video_preset { } $preset = array(); foreach ($presets as $id => $value) { - $preset[$id] = $value['name'] . ' ' . l(t('edit'), ('admin/config/media/video/presets/preset/' . $value['name'])); + $preset[$value['name']] = $value['name'] . ' ' . l(t('edit'), ('admin/config/media/video/presets/preset/' . $value['name'])); // $help[] = $value['name'] . ' - ' . $value['description'] . ' ' . l(t('edit'), preset_get_preset_path('video', $value['name'])); } @@ -62,10 +62,13 @@ class video_preset { * @return array $properties */ public function properties() { + module_load_include('inc', 'video_ui', 'video.preset'); + $presets = array(); $preset = $this->preset; - return $options['properties']; - if (preset_exists('video', $preset)) - preset_get_settings($preset); + foreach ($preset as $preset_name) { + $presets[$preset_name] = video_get_preset($preset_name); + } + return $presets; } }
\ No newline at end of file diff --git a/includes/transcoder.inc b/includes/transcoder.inc index 994ab47..e5f7123 100644 --- a/includes/transcoder.inc +++ b/includes/transcoder.inc @@ -89,22 +89,19 @@ class video_transcoder { } public function convert_video(&$video) { + // load the presets $video_preset = new video_preset(); $presets = $video_preset->properties(); $video->presets = $presets; $output = $this->transcoder->convert_video($video); // if successfully converted the video then update the status to publish - if ($output) + if ($output && variable_get('video_publish_on_complete', TRUE)) // Update our node id to published. We do not do a node_load as it causes editing problems when saving. - db_query("UPDATE {node} SET status=%d WHERE nid=%d", 1, $video->nid); - - // If they are using metadata. - // @TODO : add meta data support -// if (variable_get('video_metadata', FALSE)) { -// module_load_include('inc', 'video', '/includes/metadata'); -// $metadata = new video_metadata; -// $metadata->process($converted); -// } + db_update('node') + ->fields(array( + 'status' => NODE_PUBLISHED)) + ->condition('nid', $video->nid, '=') + ->execute(); return $output; } @@ -171,10 +168,6 @@ class video_transcoder { return $this->transcoder->create_job($video, $nid); } - public function update_job($video) { - return $this->transcoder->update_job($video); - } - public function delete_job($video) { return $this->transcoder->delete_job($video); } @@ -203,8 +196,6 @@ interface transcoder_interface { public function create_job($video, $nid); - public function update_job($video); - public function delete_job($video); public function load_job($fid); |