diff --git a/api_v3/lib/KalturaLiveEntryService.php b/api_v3/lib/KalturaLiveEntryService.php index 3e4ecd26fa0..58958c6276e 100644 --- a/api_v3/lib/KalturaLiveEntryService.php +++ b/api_v3/lib/KalturaLiveEntryService.php @@ -217,7 +217,6 @@ function registerMediaServerAction($entryId, $hostname, $mediaServerIndex, $appl $this->setMediaServerWrapper($dbLiveEntry, $mediaServerIndex, $hostname, $liveEntryStatus, $applicationName); // setRedirectEntryId to null in all cases, even for broadcasting... - $dbLiveEntry->setRedirectEntryId(null); $dbLiveEntry->save(); return $this->checkAndCreateRecordedEntry($dbLiveEntry, $mediaServerIndex, $liveEntryStatus, true, $shouldCreateRecordedEntry); diff --git a/api_v3/lib/types/entry/KalturaLiveEntry.php b/api_v3/lib/types/entry/KalturaLiveEntry.php index 211667deb00..5b1729ed7bc 100644 --- a/api_v3/lib/types/entry/KalturaLiveEntry.php +++ b/api_v3/lib/types/entry/KalturaLiveEntry.php @@ -208,15 +208,13 @@ public function doFromObject($dbObject, KalturaDetachedResponseProfile $response $this->recordingOptions->fromObject($dbObject->getRecordingOptions()); } - if ($dbObject->getExplicitLive()) + if ($this->isPlayable($dbObject)) { - if ($dbObject->getViewMode() == ViewMode::ALLOW_ALL && in_array($dbObject->getLiveStatus(), array(KalturaEntryServerNodeStatus::PLAYABLE, KalturaEntryServerNodeStatus::BROADCASTING))) - { - $this->redirectEntryId = null; - } else - { - $this->redirectEntryId = $this->recordedEntryId; - } + $this->redirectEntryId = null; + kApiCache::setExpiry( kApiCache::REDIRECT_ENTRY_CACHE_EXPIRY ); + } else + { + $this->redirectEntryId = $this->recordedEntryId; } } @@ -354,4 +352,13 @@ private function hasPropertyChanged($sourceObject, $attr) return false; } + /** + * @param $dbObject + * @return bool + */ + protected function isPlayable($dbObject): bool + { + return $dbObject->getViewMode() == ViewMode::ALLOW_ALL && in_array($dbObject->getLiveStatus(), array(KalturaEntryServerNodeStatus::PLAYABLE, KalturaEntryServerNodeStatus::BROADCASTING, KalturaEntryServerNodeStatus::AUTHENTICATED)); + } + }