summaryrefslogtreecommitdiff
path: root/frontend/site/audio
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2021-04-06 18:14:51 +0200
committerJules Laplace <julescarbon@gmail.com>2021-04-06 18:14:51 +0200
commit477bd86c8f1be01ec2fb2d1f99f964b78690d135 (patch)
treef195aa41f3dda5202cb19b8ce696a871f693e63a /frontend/site/audio
parentafae590581c61c1f55470d7beb9d84a4c0c77c50 (diff)
stop all sounds
Diffstat (limited to 'frontend/site/audio')
-rw-r--r--frontend/site/audio/audio.player.js9
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