You are here

public function video_transcoder::convert_video in Video 6.4

Same name and namespace in other branches
  1. 6.5 video.lib.inc \video_transcoder::convert_video()
  2. 7 includes/transcoder.inc \video_transcoder::convert_video()

File

includes/transcoder.inc, line 63

Class

video_transcoder

Code

public function convert_video(&$video) {
  module_load_include('inc', 'video', '/includes/preset');
  $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) {

    // 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);
  //    }
  return $output;
}