Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function setSaveData(data) {
Howler.unload();
Pool = {};
Howler.mute(data.globalMuted);
Howler.volume(data.globalVolume);
ChannelVolume = data.channelVolume;
const channelData = data.channelData;
for (const item of channelData) {
create(item.channel, item.src, {
volume: item.volume,
loop: item.loop,
autoplay: false,
mute: item.mute,
rate: item.rate
});
// Pool[item.channel].seek(item.seek);
mute() {
$('.mute img').attr('src', 'images/icon-mute.svg');
localStorage.muted = 'true';
Howler.mute(true);
this.muted = true;
}
api.unmuteAll = function () {
Howler.mute(false);
};
toggleMuted() {
Howler.mute(!music.state.muted)
music.state.muted = !music.state.muted
},
mute() {
Howler.mute();
}
blur() {
Howler.mute(true);
}
focus() {
if (!this.muted) {
Howler.mute(false);
}
}
muted(value) {
Howler.mute(value);
},
},
api.muteAll = function () {
Howler.mute(true);
};