You are here

public function video_transcoder::convert_video in Video 7

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

File

includes/transcoder.inc, line 100

Class

video_transcoder

Code

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 && 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_update('node')
      ->fields(array(
      'status' => NODE_PUBLISHED,
    ))
      ->condition('nid', $video->nid, '=')
      ->execute();
    db_update('node_revision')
      ->fields(array(
      'status' => NODE_PUBLISHED,
    ))
      ->condition('nid', $video->nid, '=')
      ->execute();
  }
  return $output;
}