Embed player - code review fixes
This commit is contained in:
parent
481d21ff70
commit
f6d5b34cca
5 changed files with 89 additions and 48 deletions
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
define("OPUS", "opus");
|
||||
|
||||
class Application_Form_EmbeddablePlayer extends Zend_Form_SubForm
|
||||
{
|
||||
public function init()
|
||||
|
@ -8,17 +10,19 @@ class Application_Form_EmbeddablePlayer extends Zend_Form_SubForm
|
|||
array('ViewScript', array('viewScript' => 'form/embeddableplayer.phtml'))
|
||||
));
|
||||
|
||||
/* We will use this option in the future
|
||||
$displayTrackMetadata = new Zend_Form_Element_Checkbox('player_display_track_metadata');
|
||||
$displayTrackMetadata->setValue(true);
|
||||
$displayTrackMetadata->setLabel(_('Display track metadata?'));
|
||||
$this->addElement($displayTrackMetadata);
|
||||
*/
|
||||
|
||||
$streamMode = new Zend_Form_Element_Radio('player_stream_mode');
|
||||
$streamMode->setLabel(_('Select Stream:'));
|
||||
$streamMode->setMultiOptions(
|
||||
array(
|
||||
"auto" => "Auto detect the most appropriate stream to use.",
|
||||
"manual" => "Select a stream:"
|
||||
"auto" => _("Auto detect the most appropriate stream to use."),
|
||||
"manual" => _("Select a stream:")
|
||||
)
|
||||
);
|
||||
$streamMode->setValue("auto");
|
||||
|
@ -30,19 +34,20 @@ class Application_Form_EmbeddablePlayer extends Zend_Form_SubForm
|
|||
foreach(Application_Model_StreamSetting::getEnabledStreamData() as $stream => $data) {
|
||||
$urlOptions[$stream] = strtoupper($data["codec"])." - ".$data["bitrate"]."kbps";
|
||||
if ($data["mobile"]) {
|
||||
$urlOptions[$stream] .= " - Mobile friendly";
|
||||
$urlOptions[$stream] .= _(" - Mobile friendly");
|
||||
}
|
||||
if ($data["codec"] == "opus") {
|
||||
if ($data["codec"] == OPUS) {
|
||||
$opusStreamCount += 1;
|
||||
$urlOptions[$stream] .=" - The player does not support Opus streams.";
|
||||
$urlOptions[$stream] .= _(" - The player does not support Opus streams.");
|
||||
}
|
||||
}
|
||||
$streamURL->setMultiOptions(
|
||||
$urlOptions
|
||||
);
|
||||
|
||||
// Set default value to the first non-opus stream we find
|
||||
foreach ($urlOptions as $o => $v) {
|
||||
if (strpos(strtolower($v), "opus") !== false) {
|
||||
if (strpos(strtolower($v), OPUS) !== false) {
|
||||
continue;
|
||||
} else {
|
||||
$streamURL->setValue($o);
|
||||
|
@ -62,7 +67,7 @@ class Application_Form_EmbeddablePlayer extends Zend_Form_SubForm
|
|||
$this->addElement($embedSrc);
|
||||
|
||||
$previewLabel = new Zend_Form_Element_Text('player_preview_label');
|
||||
$previewLabel->setLabel("Preview:");
|
||||
$previewLabel->setLabel(_("Preview:"));
|
||||
$this->addElement($previewLabel);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue