You are here

public function video_localcommand::load_completed_job in Video 6.5

Overrides video_transcoder::load_completed_job

File

transcoders/video_localcommand.inc, line 380

Class

video_localcommand

Code

public function load_completed_job(stdClass $video) {
  $result = db_fetch_object(db_query('SELECT data FROM {video_files} WHERE fid = %d', $video->fid));
  foreach (unserialize($result->data) as $value) {
    $extension = pathinfo($value->filepath, PATHINFO_EXTENSION);
    $video->files->{$extension} = new stdClass();
    $video->files->{$extension}->filename = pathinfo($value->filepath, PATHINFO_FILENAME) . '.' . $extension;
    $video->files->{$extension}->filepath = $value->filepath;
    $video->files->{$extension}->url = file_create_url($value->filepath);
    $video->files->{$extension}->extension = $extension;
    $video->files->{$extension}->filemime = file_get_mimetype($value->filepath);
    $video->player = drupal_strtolower($extension);
  }
  return $video;
}