Forum Discussion
Background Audio Cool Trick
Hi All,
Just wanted to share a way to add audio across all slides in Storyline 2 There are a few posts on here about this, and I found this method to be super simple.
**Please note that this is just a cool trick, and not a built in feature of Storyline 2.
Publish your course, open the story.html file with Notepad, scroll to the bottom and add this code
<audio src="YOURAUDIOHERE.mp3" preload="auto" autoplay loop></audio> with a space before the </body> and place your audio file into the published output folder and there you go. That is it.
Here is an example, http://bit.ly/1sy5dkV and the output folder is attached.
Have fun!
Hello, Everyone! ✨
I'm happy to share that we have released a new update for Storyline 360 (Build 3.79.30834.0).
In this update, we have an enhancement where:
- Background audio is now supported in the published video output.
As a first step, I recommend updating Storyline 360 to the latest version. Here's how:
If you have any questions, please let us know in this thread or privately in a support case.
Have a great day!
- AnnaLaMontCommunity Member
To mute/ stop background music is not so easy, there are some suggestions in other conversations.. I never succeeded with that, quite complicated. :)
- AnnaLaMontCommunity Member
It works, I use it regularly. Just add the script to Story and index_lms when you open them with Notepad.
- MaribethChristeCommunity Member
Chrome and Edge block the Auto-Play. It works in Firefox (which is restricted in my environment) and IE. I have it going in IE but IE isn't great, so am trying another workaround. I'm not publishing to a LMS.
- AnnaLaMontCommunity Member
I see.. Sorry I thought you were doing it in LMS, which does work from Chrome for me.. :)
- MaribethChristeCommunity Member
All good! Super appreciate the assistance either way 😊
- StephanieGar113Community Member
- RamyElsonbatyCommunity Member
Hello, It doesn't seem to work with me, I tried opening your attached file but there is no music that plays, were there any updates that made this stop working?
- JorgeAndrsPintaCommunity Member
I can't believe this worked at the first try, things are not usually this easy. Thank you so much!
- Jürgen_Schoene_Community Member
audio autoplay (without user interaction) is disabled on all current browsers
- OwenHoltSuper Hero
But you can "fake" user interaction by using a blank opening slide that automatically transitions to your opening slide. Most browsers will read this as user interaction.
This is why I prefer the JavaScript option to add music that will play throughout the course.- Jürgen_Schoene_Community Member
A simulated click via Javascript is a clear attack on users. The user must have at least made a 'user interaction' on the page (Chrome) or tap a button per audio object (iOS Chrome, Safari, Firefox) or set the domain on a whitelist (Firefox).
The only method accepted by all current/future* browsers is the use of promise and possibly showing a button.https://developer.chrome.com/blog/autoplay/
var promise = document.querySelector('audio').play();
if (promise !== undefined) {
promise.then(_ => {
// Autoplay started!
}).catch(error => {
// Autoplay was prevented.
// Show a "Play" button so that user can start playback.
});
}*as far as you can see into the future
- ThaddeusAshclifCommunity Member
When I tried I didn't hear any audio. Which is probably for the best because I didn't see any button to turn of the audio. Always include the option to mute music.
- OwenHoltSuper Hero
Of course. That goes without saying. This is a POC (proof of concept) and not a course. What browser are you using? Also note, the audio volume is set low but I would normally also add in volume controls.
- Jürgen_Schoene_Community Member
fun fact: exactly this problem (how to start an audio automatically) had been a bug in storyline for years - which now leads to the fact that all courses with audio from the last years have to be re-published to start with firefox 103* and newer.
autoplay with audio is a minefield* there was a special (not ever tested) firefox solution integrated, which did't worked
- WendySchorr-aa5Community Member
The bit.ly link above no longer works.