private function serveVodEntry() { $this->initFlavorIds(); if ($this->entry->getPartner()->getForceCdnHost()) { $this->cdnHost = myPartnerUtils::getCdnHost($this->entry->getPartnerId(), $this->protocol); } $this->initFlavorAssetArray(); $this->initEntryDuration(); if ($this->duration && $this->duration < 10 && $this->deliveryAttributes->getFormat() == PlaybackProtocol::AKAMAI_HDS) { // videos shorter than 10 seconds cannot be played with HDS, fall back to HTTP $this->deliveryAttributes->setFormat(PlaybackProtocol::HTTP); $flavorAssets = $this->deliveryAttributes->getFlavorAssets(); $flavorAsset = reset($flavorAssets); $this->deliveryAttributes->setFlavorAssets(array($flavorAsset)); } $this->initStorageProfile(); // Fixing ALL kinds of historical bugs. if ($this->deliveryAttributes->getFormat() == self::URL) { if (is_null($this->deliveryAttributes->getResponseFormat())) { $this->deliveryAttributes->setResponseFormat('redirect'); } $this->deliveryAttributes->setFormat(PlaybackProtocol::HTTP); } else { if ($this->deliveryAttributes->getFormat() == PlaybackProtocol::AKAMAI_HD) { // This is a hack to return an f4m that has a URL of a smil return $this->serveHDNetwork(); } else { if ($this->deliveryAttributes->getFormat() == self::HDNETWORKSMIL) { // Translate to playback protocol format $this->deliveryAttributes->setFormat(PlaybackProtocol::AKAMAI_HD); } else { if ($this->deliveryAttributes->getFormat() == PlaybackProtocol::RTMP) { if (strpos($this->deliveryAttributes->getMediaProtocol(), "rtmp") !== 0) { $this->deliveryAttributes->setMediaProtocol("rtmp"); } } else { if ($this->deliveryAttributes->getFormat() == PlaybackProtocol::HTTP) { if (strpos($this->deliveryAttributes->getMediaProtocol(), "http") !== 0) { $this->deliveryAttributes->setMediaProtocol("http"); } } } } } } // <-- $this->deliveryProfile = $this->initDeliveryProfile(); if (!$this->deliveryProfile) { return null; } $this->enforceAudioVideoEntry(); $this->deliveryProfile->setDynamicAttributes($this->deliveryAttributes); return $this->deliveryProfile->serve(); }