Background Music Java Script Controls?

Jul 26, 2023

Hi everyone,

the new Background-Music feature really keeps a lot of workarounds off our backs - that's great.

However, as settings are very limited at the moment, I am wondering whether the Background-Music and -Playlist can be controlled via JavaScript Triggers - e.g. manually setting the volume or mute only the Background Music (most important), start/stop the playlist, selecting a certain track from the playlist, etc...

Any Heroes around who can help me out?

3 Replies
Nedim Ramic

To do exactly what the "Background audio" switch does (pause and play), you may follow these steps:
1. Create a custom T/F variable and set it to True (eg. bgAudioActive = True)
2. Insert a button with Normal and Selected state
3. Create a trigger Execute JavaScript When the user clicks Button
const bgAudioSwitch = document.getElementById("backgroundAudio-switch");
bgAudioSwitch.click();
4. Create a trigger Toggle bgAudioActive When the user clicks Button