/** * Returns the url for the given flavor. in case of rtmp, return the file path in order ot use a local streaming server * * @param flavorAsset $flavorAsset * @return string */ protected function doGetFlavorAssetUrl(flavorAsset $flavorAsset) { if ($this->protocol != StorageProfile::PLAY_FORMAT_RTMP) { return parent::doGetFlavorAssetUrl($flavorAsset); } $syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET); $fileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($syncKey); $url = $this->doGetFileSyncUrl($fileSync); if ($this->extention && strtolower($this->extention) != 'flv' || $this->containerFormat && strtolower($this->containerFormat) != 'flash video') { $url = "mp4:{$url}"; } $url = str_replace('\\', '/', $url); return $url; }
/** * @param flavorAsset $flavorAsset * @return string */ protected function doGetFlavorAssetUrl(flavorAsset $flavorAsset) { $url = parent::doGetFlavorAssetUrl($flavorAsset); $url = preg_replace('/^mp4:(\\/)*/', 'mp4:', $url); // move version param to "behind" the flavor asset id $flavorAssetId = $flavorAsset->getId(); $flavorIdStr = '/flavorId/' . $flavorAssetId; $url = str_replace($flavorIdStr, '', $url); $url = str_replace('serveFlavor', 'serveFlavor' . $flavorIdStr, $url); if ($this->protocol == StorageProfile::PLAY_FORMAT_HTTP) { if ($this->extention) { $url .= "/name/a.{$this->extention}"; } $syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET); $url = $this->addEcSeek($url, $syncKey); } return $url; }