summaryrefslogtreecommitdiff
path: root/frontend/site/audio/audio.player.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/site/audio/audio.player.js')
-rw-r--r--frontend/site/audio/audio.player.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/frontend/site/audio/audio.player.js b/frontend/site/audio/audio.player.js
index d036347..fcdcb6f 100644
--- a/frontend/site/audio/audio.player.js
+++ b/frontend/site/audio/audio.player.js
@@ -37,9 +37,14 @@ export default class AudioPlayer {
delete this.players[id]
}
+ toggleMuted(muted) {
+ this.muted = muted
+ Object.keys(this.players).forEach(id => this.players[id].toggleMuted(muted))
+ }
+
playPage(page) {
const { background_audio_id, restart_audio, stop_all_sounds } = page.settings
- console.log('playPage', page)
+ // console.log('playPage', page)
if (stop_all_sounds && this.current_background_id !== background_audio_id) {
Object.keys(this.players).forEach(id => this.stop(id))
} else if (
@@ -86,8 +91,9 @@ export default class AudioPlayer {
item,
tile,
type,
- done: this.done
+ done: this.done,
})
+ this.players[id].toggleMuted(this.muted)
this.players[id].play()
return this.players[id]
}
@@ -100,6 +106,7 @@ export default class AudioPlayer {
type: "url",
done: this.done
})
+ this.players[id].toggleMuted(this.muted)
this.players[id].play()
return this.players[id]
}
@@ -120,6 +127,10 @@ class Player {
this.audio.src = item.url
}
+ toggleMuted(muted) {
+ this.audio.muted = muted
+ }
+
release() {
if (this.type === 'click' && this.tile && this.tile.settings.navigate_when_audio_finishes) {
history.push(this.tile.href)