Skip to content

Commit

Permalink
Merge pull request kaltura#11318 from kaltura/Quasar-17.18.0-PLAT-23259
Browse files Browse the repository at this point in the history
PLAT-23259: add "shouldRedirect" flag to live delivery profile
  • Loading branch information
Amirhalfon1 authored Jan 2, 2022
2 parents 5e92bea + 51c320a commit 679ef74
Show file tree
Hide file tree
Showing 4 changed files with 27 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');
}
}
16 changes: 15 additions & 1 deletion alpha/lib/model/DeliveryProfileLive.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

abstract class DeliveryProfileLive extends DeliveryProfile {
const DEFAULT_MAINTENANCE_DC = -1;
const SHOULD_REDIRECT = "should_redirect";

/**
* @var kLiveStreamConfiguration
Expand Down Expand Up @@ -398,7 +399,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 +463,18 @@ public function getLivePackagerSigningDomain()
{
return $this->getFromCustomData("livePackagerSigningDomain");
}

public function setShouldRedirect($v)
{
// sets only the default value in custom data (won't affect "$this->shouldRedirect" which should be changed dynamically)
$this->putInCustomData(self::SHOULD_REDIRECT, $v);
}

public function getShouldRedirect()
{
// if the shouldRedirect changed to true dynamically during the request - it takes priority
return $this->shouldRedirect || $this->getFromCustomData(self::SHOULD_REDIRECT, 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 679ef74

Please sign in to comment.