Skip to content

Commit

Permalink
PLAT-23259: add "shouldRedirect" flag to live delivery profile
Browse files Browse the repository at this point in the history
add "shouldRedirect" flag to KalturaDeliveryProfileLivePackager (configurable from admin console form)
  • Loading branch information
Amirhalfon1 committed Dec 29, 2021
1 parent f1136ab commit 49cf87e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
6 changes: 5 additions & 1 deletion admin_console/forms/Delivery/DeliveryProfileLivePackager.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public function getAdvancedSettings()
'filters' => array('StringTrim'),
));

return array('livePackagerSigningDomain');
$this->addElement('checkbox', 'shouldRedirect', array(
'label' => 'Should redirect:',
));

return array('livePackagerSigningDomain', 'shouldRedirect');
}
}
15 changes: 14 additions & 1 deletion alpha/lib/model/DeliveryProfileLive.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ private function generateLiveSecuredPackagerToken($url)

protected function getRenderer($flavors)
{
if($this->shouldRedirect)
if($this->getShouldRedirect())
{
$this->DEFAULT_RENDERER_CLASS = 'kRedirectManifestRenderer';
}
Expand Down Expand Up @@ -462,5 +462,18 @@ public function getLivePackagerSigningDomain()
{
return $this->getFromCustomData("livePackagerSigningDomain");
}

public function setShouldRedirect($v)
{
$this->shouldRedirect = $v;
$this->putInCustomData("shouldRedirect", $v);
}

public function getShouldRedirect()
{
// if the shouldRedirect changed to true dynamically during the request - it takes priority
return $this->shouldRedirect || $this->getFromCustomData("shouldRedirect", null, false);
}

}

2 changes: 1 addition & 1 deletion alpha/lib/model/DeliveryProfileLiveAppleHttp.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ protected function buildHttpFlavorsArray()
if($this->getDynamicAttributes()->getUsePlayServer() || (!count($primaryStreamInfo) && !count($backupStreamInfo)))
$this->shouldRedirect = true;

if($this->shouldRedirect)
if($this->getShouldRedirect())
{
return parent::buildHttpFlavorsArray();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ class KalturaDeliveryProfileLivePackager extends KalturaDeliveryProfile {
* @var string
*/
public $livePackagerSigningDomain;

/**
* @var bool
*/
public $shouldRedirect;

private static $map_between_objects = array
(
"livePackagerSigningDomain",
"shouldRedirect"
);

public function getMapBetweenObjects ( )
Expand Down

0 comments on commit 49cf87e

Please sign in to comment.