fix player null on volume/mute change
This commit is contained in:
parent
dff4ecc42c
commit
8b36d79420
8
radio.js
8
radio.js
|
@ -109,7 +109,7 @@ function startStation(new_station) {
|
|||
setVisualizer(tuner.analysers, visualizer.mode);
|
||||
|
||||
// Properly set volume value.
|
||||
tuner.player.audioElement.volume = tuner.volume/100;
|
||||
if (!tuner.isMuted) tuner.player.audioElement.volume = tuner.volume/100;
|
||||
play();
|
||||
}
|
||||
|
||||
|
@ -144,19 +144,19 @@ function mute() {
|
|||
if (tuner.isMuted) {
|
||||
document.querySelector('.volume').classList.remove('active');
|
||||
document.querySelector('.volslider').title = tuner.volume+'%';
|
||||
tuner.player.audioElement.volume=tuner.volume/100;
|
||||
if (tuner.player) tuner.player.audioElement.volume=tuner.volume/100;
|
||||
} else {
|
||||
document.querySelector('.volume').classList.add('active');
|
||||
document.querySelector('.volslider').title = "Muted";
|
||||
tuner.player.audioElement.volume=0;
|
||||
if (tuner.player) tuner.player.audioElement.volume=0;
|
||||
}
|
||||
tuner.isMuted = !tuner.isMuted;
|
||||
}
|
||||
|
||||
function volChange(e) {
|
||||
tuner.player.audioElement.volume=e.value/100;
|
||||
e.parentNode.title = e.value+'%';
|
||||
tuner.volume = e.value;
|
||||
if (tuner.player) tuner.player.audioElement.volume=e.value/100;
|
||||
}
|
||||
|
||||
function updateMetadata(track) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user