diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 2958243a5..ffb46b97f 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -805,9 +805,10 @@ class ApiController extends Zend_Controller_Action $msg = $request->getParam('msg'); $sourcename = $request->getParam('sourcename'); $status = $request->getParam('status'); - + // 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"); Application_Model_RabbitMq::SendMessageToPypo("switch_source", $data); Application_Model_Preference::SetSourceSwitchStatus($sourcename, "off"); diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 49c31af07..a78bfd6e2 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -214,6 +214,7 @@ class PreferenceController extends Zend_Controller_Action Application_Model_Preference::SetLiveSteamMasterUsername($values["master_username"]); Application_Model_Preference::SetLiveSteamMasterPassword($values["master_password"]); Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]); + Application_Model_Preference::SetAutoTransition($values["auto_transition"]); if (!$isSaas) { $master_connection_url = "http://".$_SERVER['SERVER_NAME'].":".$values["master_harbor_input_port"]."/".$values["master_harbor_input_mount_point"]; diff --git a/airtime_mvc/application/forms/LiveStreamingPreferences.php b/airtime_mvc/application/forms/LiveStreamingPreferences.php index 41e0dd186..91dfb3bec 100644 --- a/airtime_mvc/application/forms/LiveStreamingPreferences.php +++ b/airtime_mvc/application/forms/LiveStreamingPreferences.php @@ -15,7 +15,14 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm $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->setLabel("Switch Transition Fade (s)") ->setFilters(array('StringTrim')) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 62eb62ee0..cfb5d8f39 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -840,6 +840,14 @@ class Application_Model_Preference 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) { self::SetValue("enable_system_email", $upload); } diff --git a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml index 013ecf5ee..f25a5abe8 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml @@ -1,6 +1,22 @@
Input Stream Settings
+
+ +
+
+ element->getElement('auto_transition') ?> + element->getElement('auto_transition')->hasErrors()) : ?> +
    + element->getElement('auto_transition')->getMessages() as $error): ?> +
  • + +
+ +
@@ -74,7 +90,7 @@
-
@@ -117,7 +133,7 @@
-
diff --git a/airtime_mvc/public/js/airtime/preferences/streamsetting.js b/airtime_mvc/public/js/airtime/preferences/streamsetting.js index cdede0d38..d453edefe 100644 --- a/airtime_mvc/public/js/airtime/preferences/streamsetting.js +++ b/airtime_mvc/public/js/airtime/preferences/streamsetting.js @@ -260,7 +260,28 @@ $(document).ready(function() { $(".icecast_metadata_help_icon").qtip({ 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: { delay: 500,