Skip to content

Commit

Permalink
Merge pull request #7929 from kaltura/Naos-14.8.0-SUP-16136_1
Browse files Browse the repository at this point in the history
Naos 14.8.0 sup 16136 1
  • Loading branch information
noam-arad committed Dec 17, 2018
2 parents 9a7dac5 + d8f790c commit 179fb0e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
1 change: 0 additions & 1 deletion api_v3/lib/KalturaLiveEntryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
23 changes: 15 additions & 8 deletions api_v3/lib/types/entry/KalturaLiveEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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));
}

}

0 comments on commit 179fb0e

Please sign in to comment.