]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
WEBUI: Integrated player - implement mute toggle button, fixes #2432
authorJaroslav Kysela <perex@perex.cz>
Fri, 25 Sep 2015 15:43:41 +0000 (17:43 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 25 Sep 2015 15:43:41 +0000 (17:43 +0200)
src/webui/static/app/ext.css
src/webui/static/app/tvheadend.js
src/webui/static/icons/sound_mute.png [new symlink]
src/webui/static/tv.js

index 3ef736c89b9022eb95ede9cfa2142c17767349c4..cc9863072118d35f6a985e6465d2606723d59072 100644 (file)
     background-image: url(../icons/control_stop.png) !important;
 }
 
+.control_mute {
+    background-image: url(../icons/sound_mute.png) !important;
+}
+
 .control_volume {
     background-image: url(../icons/sound.png) !important;
 }
index f7786fa9c4eb4667b1c6cb6910c3f9766dd55355..544941e36476baa2fdd0bf835079d8622f0742e8 100644 (file)
@@ -312,6 +312,15 @@ tvheadend.VideoPlayer = function(url) {
             '-',
             selectProfile,
             '-',
+            {
+                iconCls: 'control_mute',
+                tooltip: _('Toggle mute'),
+                handler: function() {
+                    var muted = videoPlayer.muteToggle();
+                    slider.setDisabled(muted);
+                    sliderLabel.setDisabled(muted);
+                }
+            },
             {
                 iconCls: 'control_volume',
                 tooltip: _('Volume'),
diff --git a/src/webui/static/icons/sound_mute.png b/src/webui/static/icons/sound_mute.png
new file mode 120000 (symlink)
index 0000000..3f9dc8e
--- /dev/null
@@ -0,0 +1 @@
+../../../../vendor/famfamsilk/sound_mute.png
\ No newline at end of file
index bf6fb54b56530aeddd2b4336deff80d603542ce7..2e588d978c206942c23074587797432c02e180c2 100644 (file)
@@ -238,6 +238,11 @@ tv.ui.VideoPlayer = Ext.extend(Ext.Panel, (function() {
             this.video.dom.pause();
         },
 
+        muteToggle: function() {
+            this.video.dom.muted = !this.video.dom.muted;
+            return this.video.dom.muted;
+        },
+
         setVolume: function(vol) {
             this.video.dom.volume = vol / 100.0;
         },