SAAS-661: Add mobile stream identifier on Stream Settings page

This commit is contained in:
drigato 2015-03-23 16:06:35 -04:00
parent e2ca218ac2
commit e32744668f
5 changed files with 20 additions and 3 deletions

View file

@ -28,7 +28,10 @@ class Application_Form_EmbeddablePlayer extends Zend_Form_SubForm
$opusStreamCount = 0; $opusStreamCount = 0;
$urlOptions = Array(); $urlOptions = Array();
foreach(Application_Model_StreamSetting::getEnabledStreamData() as $stream => $data) { foreach(Application_Model_StreamSetting::getEnabledStreamData() as $stream => $data) {
$urlOptions[$stream] = $data["codec"]." - ".$data["bitrate"]."kbps"; $urlOptions[$stream] = strtoupper($data["codec"])." - ".$data["bitrate"]."kbps";
if ($data["mobile"]) {
$urlOptions[$stream] .= " - Mobile friendly";
}
if ($data["codec"] == "opus") { if ($data["codec"] == "opus") {
$opusStreamCount += 1; $opusStreamCount += 1;
$urlOptions[$stream] .=" - The player does not support Opus streams."; $urlOptions[$stream] .=" - The player does not support Opus streams.";

View file

@ -53,6 +53,12 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
} }
$this->addElement($enable); $this->addElement($enable);
$mobile = new Zend_Form_Element_Checkbox('mobile');
$mobile->setLabel(_('Good for mobile?'));
$mobile->setValue($setting[$prefix.'_mobile']);
$mobile->setDecorators(array('ViewHelper'));
$this->addElement($mobile);
$type = new Zend_Form_Element_Select('type'); $type = new Zend_Form_Element_Select('type');
$type->setLabel(_("Stream Type:")) $type->setLabel(_("Stream Type:"))
->setMultiOptions($stream_types) ->setMultiOptions($stream_types)

View file

@ -94,7 +94,8 @@ class Application_Model_StreamSetting
$streams[$id] = Array( $streams[$id] = Array(
"url" => "http://$host:$port/$mount", "url" => "http://$host:$port/$mount",
"codec" => $streamData[$prefix."type"], "codec" => $streamData[$prefix."type"],
"bitrate" => $streamData[$prefix."bitrate"] "bitrate" => $streamData[$prefix."bitrate"],
"mobile" => $streamData[$prefix."mobile"]
); );
} }
return $streams; return $streams;

View file

@ -14,6 +14,13 @@
<dd id="<?php echo $s_name?>Enabled-element"> <dd id="<?php echo $s_name?>Enabled-element">
<?php echo $this->element->getElement('enable')?> <?php echo $this->element->getElement('enable')?>
</dd> </dd>
<dt id="<?php echo $s_name?>Mobile-label">
<label for="<?php echo $s_name?>Mobile"><?php echo $this->element->getElement('mobile')->getLabel() ?></label>
</dt>
<dd id="<?php echo $s_name?>Mobile-element">
<?php echo $this->element->getElement('mobile')?>
</dd>
<dt id="<?php echo $s_name?>Type-label"> <dt id="<?php echo $s_name?>Type-label">
<label for="<?php echo $s_name?>Type"><?php echo $this->element->getElement('type')->getLabel()?></label> <label for="<?php echo $s_name?>Type"><?php echo $this->element->getElement('type')->getLabel()?></label>

View file

@ -29,7 +29,7 @@ $(document).ready(function() {
$("#player_stream_url-element input[type='radio']").removeAttr("disabled"); $("#player_stream_url-element input[type='radio']").removeAttr("disabled");
$("input[name=player_stream_url]").each(function(i, obj) { $("input[name=player_stream_url]").each(function(i, obj) {
if ($(this).parent().text().indexOf("opus") >= 0) { if ($(this).parent().text().toLowerCase().indexOf("opus") >= 0) {
$(this).attr("disabled", "disabled"); $(this).attr("disabled", "disabled");
} }
}); });