You are here

public function video_zencoder::load_completed_job in Video 6.5

Same name and namespace in other branches
  1. 6.4 plugins/video_zencoder/transcoders/video_zencoder.inc \video_zencoder::load_completed_job()
  2. 7 modules/video_zencoder/transcoders/video_zencoder.inc \video_zencoder::load_completed_job()

@todo : replace with the load job method

Overrides video_transcoder::load_completed_job

File

plugins/video_zencoder/transcoders/video_zencoder.inc, line 503
Transcoder class file to handle Zencoder settings and conversions.

Class

video_zencoder

Code

public function load_completed_job(stdClass $video) {
  $result = db_fetch_object(db_query('SELECT data FROM {video_zencoder} WHERE fid = %d', $video->fid));
  foreach (unserialize($result->data) as $value) {
    $path = parse_url($value->url, PHP_URL_PATH);
    $extension = pathinfo($path, PATHINFO_EXTENSION);
    $video->files->{$extension} = new stdClass();
    $video->files->{$extension}->filename = pathinfo($path, PATHINFO_FILENAME) . '.' . $extension;
    $video->files->{$extension}->filepath = drupal_substr($path, 1);

    // Remove the leading slash
    $video->files->{$extension}->url = $value->url;

    // Authentication tokens are added by video_s3->load()
    $video->files->{$extension}->extension = $extension;
    $video->files->{$extension}->filemime = file_get_mimetype($value->url);
    $video->player = drupal_strtolower($extension);
  }
  return $video;
}