Use standard mixer controls to mute / un-mute.

This commit is contained in:
jcass 2016-01-26 16:29:56 +02:00
parent 1f45a7f4ac
commit d4ed52ac32
2 changed files with 9 additions and 13 deletions

View File

@ -410,11 +410,6 @@ function setPosition(pos) {
function setVolume(value) {
if (value != currentVolume) {
$("#volumeslider").val(value).slider('refresh');
if (value > 0) {
$("#mutebt").attr('class', 'fa fa-volume-off');
} else {
$("#mutebt").attr('class', 'fa fa-volume-up');
}
}
}
@ -432,13 +427,14 @@ function triggerVolume() {
function doMute() {
//only emit the event, not the status
if (currentVolume > 0) {
muteVolume = currentVolume
setVolume(0);
} else {
setVolume(muteVolume);
muteVolume = -1;
}
mopidy.mixer.getMute().then(function(mute) {
mopidy.mixer.setMute(!mute).then();
if (!mute) {
$("#mutebt").attr('class', 'fa fa-volume-up');
} else {
$("#mutebt").attr('class', 'fa fa-volume-off');
}
});
}
/*******

View File

@ -1,6 +1,6 @@
CACHE MANIFEST
# 2016-01-25:v1
# 2016-01-26:v1
CACHE:
index.html