Only show enable audio modal if not allowed

This commit is contained in:
Chris McCord 2021-11-08 14:52:45 -05:00
parent 17db535839
commit b3033d0a94

View file

@ -64,7 +64,11 @@ Hooks.AudioPlayer = {
this.player.play().then(() => { this.player.play().then(() => {
if(sync){ this.player.currentTime = nowSeconds() - this.playbackBeganAt } if(sync){ this.player.currentTime = nowSeconds() - this.playbackBeganAt }
this.progressTimer = setInterval(() => this.updateProgress(), 100) this.progressTimer = setInterval(() => this.updateProgress(), 100)
}, error => execJS("#enable-audio", "data-js-show")) }, error => {
if(error.name === "NotAllowedError"){
execJS("#enable-audio", "data-js-show")
}
})
}, },
pause(){ pause(){