hide volume controls when volume is not supported by the current output
authorSuperBFG7 <daniel@despite.ch>
Mon, 21 Jun 2021 07:28:34 +0000 (09:28 +0200)
committerSuperBFG7 <daniel@despite.ch>
Mon, 21 Jun 2021 07:28:34 +0000 (09:28 +0200)
htdocs/index.html
htdocs/js/mpd.js

index 4c5e951..169ab5a 100644 (file)
                 ></span>
               </button>
             </div>
-            <div class="btn-group" role="group">
+            <div class="btn-group" role="group" id="volume-group">
               <div class="btn btn-toolbar btn-default">
                 <span
                   id="volume-icon"
index 88d817c..18b5e38 100644 (file)
@@ -952,11 +952,14 @@ function get_appropriate_ws_url() {
 }
 
 var updateVolumeIcon = function (volume) {
+    $('#volume-group').removeClass('hide');
     $('#volume-icon').removeClass('glyphicon-volume-off');
     $('#volume-icon').removeClass('glyphicon-volume-up');
     $('#volume-icon').removeClass('glyphicon-volume-down');
 
-    if (volume == 0) {
+    if (volume == -1) {
+        $('#volume-group').addClass('hide');
+    } else if (volume == 0) {
         $('#volume-icon').addClass('glyphicon-volume-off');
     } else if (volume < 50) {
         $('#volume-icon').addClass('glyphicon-volume-down');