audio on mobile fix

This commit is contained in:
ThatOneCalculator 2023-03-31 22:06:12 -07:00
parent 63c3a21c0c
commit f70c5da0bd
No known key found for this signature in database
GPG Key ID: 8703CACD01000000

View File

@ -30,7 +30,7 @@ export function play(type: string) {
export function playFile(file: string, volume: number) { export function playFile(file: string, volume: number) {
const masterVolume = ColdDeviceStorage.get("sound_masterVolume"); const masterVolume = ColdDeviceStorage.get("sound_masterVolume");
if (masterVolume === 0) return; if (masterVolume === 0 || volume === 0 || file.toLowerCase().includes("none")) return;
const audio = setVolume(getAudio(file), volume); const audio = setVolume(getAudio(file), volume);
audio.play(); audio.play();