You are here

public function video_s3::onpostconvert in Video 6.5

Return value

bool FALSE if an error occured while doing the operation, TRUE when no operation was needed or on success

Overrides video_filesystem::onpostconvert

File

plugins/video_s3/filesystem/video_s3.inc, line 285
Class file used to store videos in Amazon S3.

Class

video_s3

Code

public function onpostconvert(stdClass $video) {
  $success = TRUE;

  // Push converted files, if any
  if (!empty($video->data)) {
    foreach ($video->data as $file) {
      if (isset($file->filepath) && !$this->s3
        ->pushFile($file)) {
        $success = FALSE;
        break;
      }
    }
  }

  // Replace the local original file after the local command has been able to access it
  if (variable_get('amazon_s3_delete_local', FALSE)) {
    $s3url = 'http://' . $video->bucket . '.s3.amazonaws.com/' . drupal_urlencode($video->filepath);
    $this->s3
      ->replaceLocalFile($video->filepath, $s3url);
  }
  return $success;
}