public function finalizeUrls(&$baseUrl, &$flavorsUrls)
 {
     if ($this->getEnforceRtmpe()) {
         $baseUrl = preg_replace('/^rtmp:\\/\\//', 'rtmpe://', $baseUrl);
         $baseUrl = preg_replace('/^rtmpt:\\/\\//', 'rtmpte://', $baseUrl);
     }
     parent::finalizeUrls($baseUrl, $flavorsUrls);
 }
 function __construct()
 {
     parent::__construct();
     $this->DEFAULT_RENDERER_CLASS = 'kF4MManifestRenderer';
 }
 protected function doServe($baseUrl, $backupUrl)
 {
     if (!$backupUrl && !$this->getForceProxy() || $this->params->getUsePlayServer()) {
         return parent::serve($baseUrl, $backupUrl);
     }
     $entry = entryPeer::retrieveByPK($this->params->getEntryId());
     /* @var $entry LiveEntry */
     if ($entry && $entry->getSyncDCs()) {
         $baseUrl = str_replace('_all.smil', '_publish.smil', $baseUrl);
         if ($backupUrl) {
             $backupUrl = str_replace('_all.smil', '_publish.smil', $backupUrl);
         }
     }
     $flavors = array();
     $this->buildM3u8Flavors($baseUrl, $flavors);
     if ($backupUrl) {
         $this->buildM3u8Flavors($backupUrl, $flavors);
     }
     foreach ($flavors as $index => $flavor) {
         $flavors[$index]['index'] = $index;
     }
     usort($flavors, array($this, 'compareFlavors'));
     foreach ($flavors as $index => $flavor) {
         unset($flavors[$index]['index']);
     }
     $this->DEFAULT_RENDERER_CLASS = 'kM3U8ManifestRenderer';
     $renderer = $this->getRenderer($flavors);
     return $renderer;
 }
 public function doServe(kLiveStreamConfiguration $liveStreamConfig)
 {
     $baseUrl = $liveStreamConfig->getUrl();
     $backupUrl = $liveStreamConfig->getBackupUrl();
     $entry = entryPeer::retrieveByPK($this->params->getEntryId());
     /* @var $entry LiveEntry */
     if ($entry && $entry->getSyncDCs()) {
         $baseUrl = str_replace('_all.smil', '_publish.smil', $baseUrl);
         if ($backupUrl) {
             $backupUrl = str_replace('_all.smil', '_publish.smil', $backupUrl);
         }
     }
     if ($this->params->getUsePlayServer()) {
         $liveStreamConfig->setUrl($this->getPlayServerUrl($baseUrl));
         $liveStreamConfig->setBackupUrl(null);
     }
     if (!$liveStreamConfig->getBackupUrl() && !$this->getForceProxy() || $this->params->getUsePlayServer() || $liveStreamConfig->getIsExternalStream()) {
         return parent::doServe($liveStreamConfig);
     }
     $flavors = array();
     $this->buildM3u8Flavors($baseUrl, $flavors);
     if ($backupUrl) {
         $this->buildM3u8Flavors($backupUrl, $flavors);
     }
     foreach ($flavors as $index => $flavor) {
         $flavors[$index]['index'] = $index;
     }
     usort($flavors, array($this, 'compareFlavors'));
     foreach ($flavors as $index => $flavor) {
         unset($flavors[$index]['index']);
     }
     $this->DEFAULT_RENDERER_CLASS = 'kM3U8ManifestRenderer';
     $renderer = $this->getRenderer($flavors);
     return $renderer;
 }
 public function getRenderer($flavors)
 {
     $this->DEFAULT_RENDERER_CLASS = 'kM3U8ManifestRenderer';
     if (!$this->liveStreamConfig->getBackupUrl() && !$this->getForceProxy() || $this->params->getUsePlayServer() || $this->liveStreamConfig->getIsExternalStream()) {
         $this->DEFAULT_RENDERER_CLASS = 'kRedirectManifestRenderer';
     }
     $renderer = parent::getRenderer($flavors);
     return $renderer;
 }