Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI: Integrated player - implement mute toggle button, fixes #2432
  • Loading branch information
perexg committed Sep 25, 2015
1 parent fa57953 commit 095156f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/webui/static/app/ext.css
Expand Up @@ -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;
}
Expand Down
9 changes: 9 additions & 0 deletions src/webui/static/app/tvheadend.js
Expand Up @@ -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'),
Expand Down
1 change: 1 addition & 0 deletions src/webui/static/icons/sound_mute.png
5 changes: 5 additions & 0 deletions src/webui/static/tv.js
Expand Up @@ -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;
},
Expand Down

0 comments on commit 095156f

Please sign in to comment.