CC-3927: Should automatically switch back to Master/Show stream if there is a

connection interruption

- done
This commit is contained in:
James 2012-06-05 16:41:41 -04:00
parent 4bcf904f92
commit b23e3d0a54
6 changed files with 60 additions and 6 deletions

View file

@ -807,7 +807,8 @@ class ApiController extends Zend_Controller_Action
$status = $request->getParam('status'); $status = $request->getParam('status');
// on source disconnection sent msg to pypo to turn off the switch // on source disconnection sent msg to pypo to turn off the switch
if($status == "false"){ // Added AutoTransition option
if($status == "false" && Application_Model_Preference::GetAutoTransition()){
$data = array("sourcename"=>$sourcename, "status"=>"off"); $data = array("sourcename"=>$sourcename, "status"=>"off");
Application_Model_RabbitMq::SendMessageToPypo("switch_source", $data); Application_Model_RabbitMq::SendMessageToPypo("switch_source", $data);
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "off"); Application_Model_Preference::SetSourceSwitchStatus($sourcename, "off");

View file

@ -214,6 +214,7 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetLiveSteamMasterUsername($values["master_username"]); Application_Model_Preference::SetLiveSteamMasterUsername($values["master_username"]);
Application_Model_Preference::SetLiveSteamMasterPassword($values["master_password"]); Application_Model_Preference::SetLiveSteamMasterPassword($values["master_password"]);
Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]); Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
if (!$isSaas) { if (!$isSaas) {
$master_connection_url = "http://".$_SERVER['SERVER_NAME'].":".$values["master_harbor_input_port"]."/".$values["master_harbor_input_mount_point"]; $master_connection_url = "http://".$_SERVER['SERVER_NAME'].":".$values["master_harbor_input_port"]."/".$values["master_harbor_input_mount_point"];

View file

@ -15,7 +15,14 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$defaultFade = '00.000000'; $defaultFade = '00.000000';
} }
//Default transition fade // automatic switch off
$auto_transition = new Zend_Form_Element_Checkbox("auto_transition");
$auto_transition->setLabel("Auto Source Transition")
->setValue(Application_Model_Preference::GetAutoTransition())
->setDecorators(array('ViewHelper'));
$this->addElement($auto_transition);
// Default transition fade
$transition_fade = new Zend_Form_Element_Text("transition_fade"); $transition_fade = new Zend_Form_Element_Text("transition_fade");
$transition_fade->setLabel("Switch Transition Fade (s)") $transition_fade->setLabel("Switch Transition Fade (s)")
->setFilters(array('StringTrim')) ->setFilters(array('StringTrim'))

View file

@ -840,6 +840,14 @@ class Application_Model_Preference
return self::GetValue("live_dj_source_connection_url"); return self::GetValue("live_dj_source_connection_url");
} }
public static function SetAutoTransition($value){
self::SetValue("auto_transition", $value, false);
}
public static function GetAutoTransition(){
return self::GetValue("auto_transition");
}
public static function SetEnableSystemEmail($upload) { public static function SetEnableSystemEmail($upload) {
self::SetValue("enable_system_email", $upload); self::SetValue("enable_system_email", $upload);
} }

View file

@ -1,6 +1,22 @@
<fieldset class="padded stream-setting-global" style="margin-top: 15px"> <fieldset class="padded stream-setting-global" style="margin-top: 15px">
<legend>Input Stream Settings</legend> <legend>Input Stream Settings</legend>
<dl class="zend_form"> <dl class="zend_form">
<dt id="auto_transition-label">
<label class="optional" for="auto_transition"><?php echo $this->element->getElement('auto_transition')->getLabel() ?> :
<span class="icecast_metadata_help_icon" id="auto_transition_help">
</span>
</label>
</dt>
<dd id="auto_transition-element">
<?php echo $this->element->getElement('auto_transition') ?>
<?php if($this->element->getElement('auto_transition')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('auto_transition')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="transition_fade-label"> <dt id="transition_fade-label">
<label class="optional" for="transition_fade"><?php echo $this->element->getElement('transition_fade')->getLabel() ?> : <label class="optional" for="transition_fade"><?php echo $this->element->getElement('transition_fade')->getLabel() ?> :
</label> </label>
@ -74,7 +90,7 @@
</dd> </dd>
<?php } ?> <?php } ?>
<dt id="master_dj_connection_url-label"> <dt id="master_dj_connection_url-label">
<label class="optional" for="master_dj_connection_url" style="white-space: nowrap"><?php echo $this->element->getElement('master_dj_connection_url')->getLabel() ?> : <label class="optional" for="master_dj_connection_url" style="white-space: nowrap">Master Source Connection URL:
</label> </label>
</dt> </dt>
<dd id="master_dj_connection_url-element"> <dd id="master_dj_connection_url-element">
@ -117,7 +133,7 @@
</dd> </dd>
<?php } ?> <?php } ?>
<dt id="live_dj_connection_url-label"> <dt id="live_dj_connection_url-label">
<label class="optional" for="live_dj_connection_url" style="white-space: nowrap"><?php echo $this->element->getElement('live_dj_connection_url')->getLabel() ?> : <label class="optional" for="live_dj_connection_url" style="white-space: nowrap">Show Source Connection URL:
</label> </label>
</dt> </dt>
<dd id="live_dj_connection_url-element"> <dd id="live_dj_connection_url-element">

View file

@ -260,7 +260,28 @@ $(document).ready(function() {
$(".icecast_metadata_help_icon").qtip({ $(".icecast_metadata_help_icon").qtip({
content: { content: {
text: "This option enables metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option." text: "Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."
},
hide: {
delay: 500,
fixed: true
},
style: {
border: {
width: 0,
radius: 4
},
classes: "ui-tooltip-dark ui-tooltip-rounded"
},
position: {
my: "left bottom",
at: "right center"
},
})
$("#auto_transition_help").qtip({
content: {
text: "Check this box to allow automatic transitions between sources. If enabled, Airtime will fallback to the next available source upon current (Master or Show) source failure. The fallback hierarchy is Master Source > Show Source > Scheduled Play."
}, },
hide: { hide: {
delay: 500, delay: 500,