diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-04-06 18:14:51 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-04-06 18:14:51 +0200 |
| commit | 477bd86c8f1be01ec2fb2d1f99f964b78690d135 (patch) | |
| tree | f195aa41f3dda5202cb19b8ce696a871f693e63a /frontend/site/audio | |
| parent | afae590581c61c1f55470d7beb9d84a4c0c77c50 (diff) | |
stop all sounds
Diffstat (limited to 'frontend/site/audio')
| -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 |
