SAAS-675: Implement "auto" mode
This commit is contained in:
parent
3d2b189dba
commit
d0f7f820a7
2 changed files with 143 additions and 32 deletions
|
@ -39,9 +39,26 @@ class EmbeddablePlayerController extends Zend_Controller_Action
|
|||
$this->view->station_name = Application_Model_Preference::GetStationName();
|
||||
$stream = $request->getParam('stream');
|
||||
$streamData = Application_Model_StreamSetting::getEnabledStreamData();
|
||||
$selectedStreamData = $streamData[$stream];
|
||||
$this->view->streamURL = $selectedStreamData["url"];
|
||||
$this->view->codec = $selectedStreamData["codec"];
|
||||
$this->view->displayMetadata = $request->getParam('display_metadata');
|
||||
|
||||
if ($stream == "auto") {
|
||||
$this->view->playerMode = "auto";
|
||||
$availableMobileStreams = array();
|
||||
$availableDesktopStreams = array();
|
||||
foreach ($streamData as $s) {
|
||||
if ($s["mobile"]) {
|
||||
array_push($availableMobileStreams, $s);
|
||||
} else if (!$s["mobile"]) {
|
||||
array_push($availableDesktopStreams, $s);
|
||||
}
|
||||
}
|
||||
$this->view->availableMobileStreams = json_encode($availableMobileStreams);
|
||||
$this->view->availableDesktopStreams = json_encode($availableDesktopStreams);
|
||||
} else {
|
||||
$this->view->playerMode = "manual";
|
||||
$selectedStreamData = $streamData[$stream];
|
||||
$this->view->streamURL = $selectedStreamData["url"];
|
||||
$this->view->codec = $selectedStreamData["codec"];
|
||||
}
|
||||
//$this->view->displayMetadata = $request->getParam('display_metadata');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue