You are here

public function video_amazon_s3::getVideoUrl in Video 6.5

Same name and namespace in other branches
  1. 6.4 plugins/video_s3/video_s3.lib.inc \video_amazon_s3::getVideoUrl()

File

plugins/video_s3/video_s3.lib.inc, line 129
Class file to handle amazon s3 transfers.

Class

video_amazon_s3

Code

public function getVideoUrl($filepath, $bucket = NULL) {
  if (variable_get('amazon_s3_private', FALSE)) {
    return $this
      ->get_authenticated_url($filepath, $bucket);
  }
  $cfdomain = variable_get('amazon_s3_cf_domain', FALSE);
  $bucket = $bucket == NULL ? $this->bucket : $bucket;
  return ($this->ssl ? 'https://' : 'http://') . ($cfdomain ? $cfdomain . '/' : $bucket . '.s3.amazonaws.com/') . drupal_urlencode($filepath);

  // Escape spaces
}