diff options
Diffstat (limited to 'frontend/site/audio/audio.player.js')
| -rw-r--r-- | frontend/site/audio/audio.player.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/frontend/site/audio/audio.player.js b/frontend/site/audio/audio.player.js index 17edeee..4f33d9d 100644 --- a/frontend/site/audio/audio.player.js +++ b/frontend/site/audio/audio.player.js @@ -31,9 +31,14 @@ export default class AudioPlayer { } playPage(page) { - const { background_audio_id, restart_audio } = page.settings + const { background_audio_id, restart_audio, stop_all_sounds } = page.settings // console.log('playPage', page) - if ( + if (stop_all_sounds) { + Object.keys(this.players).forEach(id => { + this.players[id].type = "done" + this.players[id].stop(true) + }) + } else if ( this.current_background_id && this.current_background_id !== background_audio_id && this.current_background_id in this.players |
