From: Jaroslav Kysela Date: Fri, 25 Sep 2015 15:43:41 +0000 (+0200) Subject: WEBUI: Integrated player - implement mute toggle button, fixes #2432 X-Git-Tag: v4.2.1~2048 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=095156f3e19354b37aae8df04fc3f9e73ae05c04;p=thirdparty%2Ftvheadend.git WEBUI: Integrated player - implement mute toggle button, fixes #2432 --- diff --git a/src/webui/static/app/ext.css b/src/webui/static/app/ext.css index 3ef736c89..cc9863072 100644 --- a/src/webui/static/app/ext.css +++ b/src/webui/static/app/ext.css @@ -271,6 +271,10 @@ 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; } diff --git a/src/webui/static/app/tvheadend.js b/src/webui/static/app/tvheadend.js index f7786fa9c..544941e36 100644 --- a/src/webui/static/app/tvheadend.js +++ b/src/webui/static/app/tvheadend.js @@ -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 index 000000000..3f9dc8ea5 --- /dev/null +++ b/src/webui/static/icons/sound_mute.png @@ -0,0 +1 @@ +../../../../vendor/famfamsilk/sound_mute.png \ No newline at end of file diff --git a/src/webui/static/tv.js b/src/webui/static/tv.js index bf6fb54b5..2e588d978 100644 --- a/src/webui/static/tv.js +++ b/src/webui/static/tv.js @@ -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; },