state might not always be provided in a music event

This commit is contained in:
Fabio Manganiello 2019-02-12 23:11:37 +01:00
parent 18d2c51b4e
commit 97855b1535

View file

@ -68,6 +68,7 @@ $(document).ready(function() {
}; };
} }
if ('state' in status) {
switch (status.state.toLowerCase()) { switch (status.state.toLowerCase()) {
case 'stop': case 'stop':
$playbackControls.find('button[data-action=pause]').hide(); $playbackControls.find('button[data-action=pause]').hide();
@ -116,6 +117,7 @@ $(document).ready(function() {
}, 1000); }, 1000);
break; break;
} }
}
if ('volume' in status) { if ('volume' in status) {
$volumeCtrl.val(parseInt(status.volume)); $volumeCtrl.val(parseInt(status.volume));