コード例 #1
0
 protected function doGetFlavorAssetUrl(flavorAsset $flavorAsset)
 {
     if (strpos($flavorAsset->getTags(), flavorParams::TAG_APPLEMBR) === FALSE) {
         $url = $this->getBaseUrl($flavorAsset);
         if ($this->params->getClipTo()) {
             $url .= "/clipTo/" . $this->params->getClipTo();
         }
         // we use index_0_av.m3u8 instead of master.m3u8 as temporary solution to overcome
         // an extra "redirection" done on the part of akamai.
         // the auto created master.m3u8 file contains a single item playlist to the index_0_av.m3u8 file
         // this extra "redirection" fails
         return $this->formatHdIos($url);
     } else {
         KalturaLog::err("@_!! WE DO GET TO THE ELSE");
         return parent::doGetFlavorAssetUrl($flavorAsset);
     }
 }
コード例 #2
0
 /**
  * @param flavorAsset $flavorAsset
  * @return string
  */
 public function getFlavorAssetUrl(flavorAsset $flavorAsset)
 {
     $partnerId = $flavorAsset->getPartnerId();
     $subpId = $flavorAsset->getentry()->getSubpId();
     $flavorAssetId = $flavorAsset->getId();
     $partnerPath = myPartnerUtils::getUrlForPartner($partnerId, $subpId);
     $this->setFileExtension($flavorAsset->getFileExt());
     $this->setContainerFormat($flavorAsset->getContainerFormat());
     $url = "{$partnerPath}/serveFlavor/flavorId/{$flavorAssetId}";
     if ($this->protocol == StorageProfile::PLAY_FORMAT_APPLE_HTTP) {
         if (strpos($flavorAsset->getTags(), flavorParams::TAG_APPLEMBR) === FALSE) {
             $url = "http://" . @$this->params['hd_ios'] . "/i" . $url . "/index_0_av.m3u8";
         } else {
             $url .= "/file/playlist.m3u8";
         }
     } else {
         if ($this->clipTo) {
             $url .= "/clipTo/{$this->clipTo}";
         }
         if ($this->extention) {
             $url .= "/name/{$flavorAssetId}.{$this->extention}";
         }
         if ($this->protocol == StorageProfile::PLAY_FORMAT_RTMP) {
             $url .= '/forceproxy/true';
             if ($this->extention && strtolower($this->extention) != 'flv' || $this->containerFormat && strtolower($this->containerFormat) != 'flash video') {
                 $url = "mp4:{$url}";
             }
         } else {
             if ($this->seekFromTime > 0) {
                 $url .= '?aktimeoffset=' . floor($this->seekFromTime / 1000);
             }
         }
     }
     if ($this->protocol == "hdnetworksmil") {
         $url = "http://" . $this->params["hd_flash"] . $url;
     }
     $url = str_replace('\\', '/', $url);
     if ($this->protocol == StorageProfile::PLAY_FORMAT_HTTP && @$this->params['http_auth_salt']) {
         $window = $this->params['http_auth_seconds'];
         $param = $this->params['http_auth_param'];
         $salt = $this->params['http_auth_salt'];
         $root_dir = $this->params['http_auth_root_dir'];
         $url = $this->urlauth_gen_url($root_dir . $url, $param, $window, $salt, null, null);
     }
     return $url;
 }