private function serveLiveEntry() { if (in_array($this->entry->getSource(), LiveEntry::$kalturaLiveSourceTypes)) { if (!$this->entry->hasMediaServer()) { KExternalErrors::dieError(KExternalErrors::ENTRY_NOT_LIVE, "Entry [{$this->entryId}] is not broadcasting"); } kApiCache::setExpiry(120); } list($baseUrl, $backupUrl) = $this->getLiveEntryBaseUrls(); $cdnHost = parse_url($baseUrl, PHP_URL_HOST); if ($this->deliveryAttributes->getFormat() == PlaybackProtocol::MULTICAST_SL) { $this->deliveryAttributes->setFormat(PlaybackProtocol::HDS); } $this->deliveryProfile = DeliveryProfilePeer::getLiveDeliveryProfileByHostName($cdnHost, $this->deliveryAttributes); if (!$this->deliveryProfile) { return null; } $this->deliveryProfile->setDynamicAttributes($this->deliveryAttributes); return $this->deliveryProfile->serve($baseUrl, $backupUrl); }
private function serveLiveEntry() { if (in_array($this->entry->getSource(), LiveEntry::$kalturaLiveSourceTypes)) { if (!$this->entry->hasMediaServer()) { KExternalErrors::dieError(KExternalErrors::ENTRY_NOT_LIVE, "Entry [{$this->entryId}] is not broadcasting"); } kApiCache::setExpiry(120); } $liveStreamConfig = $this->getLiveEntryStreamConfig(); if (!$liveStreamConfig) { KExternalErrors::dieError(KExternalErrors::LIVE_STREAM_CONFIG_NOT_FOUND, "Live stream playbck configuration not found for entry [{$this->entryId}]"); } $cdnHost = parse_url($liveStreamConfig->getUrl(), PHP_URL_HOST); if ($this->deliveryAttributes->getFormat() == PlaybackProtocol::MULTICAST_SL) { $this->deliveryAttributes->setFormat(PlaybackProtocol::HDS); } $this->deliveryProfile = DeliveryProfilePeer::getLiveDeliveryProfileByHostName($cdnHost, $this->deliveryAttributes); if (!$this->deliveryProfile) { return null; } $this->deliveryProfile->setDynamicAttributes($this->deliveryAttributes); return $this->deliveryProfile->serve($liveStreamConfig); }