Background Audio Cool Trick
By
Emily Ruby
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!
256 Replies
I've used this trick before, and it was very helpful. But recently it no longer works in Chrome. Still works in IE and Fire fox though.
It sounds like it's a result of a new decision by chrome to mute autoplay adds, and my embedded audio is getting caught up in it.
Has anyone else encountered this, and have a new work around?
I am unable to use any of these methods. Do we have an update on how to add music to run through all slides?
as long as you are not developing for the mobile player, the javascript solution still works great if you use some interaction to start it. The user has to interact with the page to get around the chrome updates.
Code did not work for me either.
Original requests for this feature go back 5 years. A couple years ago Emily finally comes up with a work around to make up for Articulate's lack of development of desired features. Then you break the work around with the new release? Frankly, someone over there isn't thinking.
Just give us the damn feature already.
Agreed. I see more emails about this topic than any other.
Exactly! It can't be that hard, Adobe Captivate has it!
Hi,
It is not working for me. I added that code in the story.html file before </body>. But it doesn't work for me. What would be the reason?
Thanks!
a pity that there is no regular solution yet
Sorry to bring this back, but is there a way to only loop the background music for specific set of slides? For example, I have 1-50 slides, I only want to loop the music in slide 5-8. Thank you.
Thanks for your response.
Can you explain how to loop the background music?
Thanks,
Greeshma
Any help with this is greatly appreciated.
Hello! I found this trick reaaaally cool and useful but I'd really need to solve this issue with Chrome too :(
Please please please Storyline developers add this feature to the next player upgrade!!!
If you're publishing in html5, you should follow a comment in the first page that explain how to add the html tag in the story_html5 file! :)
Looks like Chrome 70 and later broke this for us :(
This works on Edge but Chrome will not play the music.
Hi
Has anyone had any luck with this code and publishing to an LMS? Using 360... so many attempts and nothing seems to be working! HELP!
I can hardly believe it, but I did get this to work today in Chrome and IE on Cornerstone On demand LMS on a Windows 10 laptop. Today I have Version 72.0.3626.96 (Official Build) (64-bit). However yesterday I had Version 71 something. Who knows. Here are the details:
1. I'm running Storyline 360 October 30, 2018 version (due to two other bugs that I hope get fixed sometime).
2. Published using SCORM 2004 3rd edition, HTML 5/Flash. (Note: publishing with HTML5 did not work for me)
3. I opened the folder for the course in Documents>My Articulate Projects (or wherever you publish to).
4. I added my sound file (yourmusicfilename.mp3) to the root of my published course.
4. Code:<audio src="yourmusicfilename.mp3" preload="auto" autoplay loop></audio>
I added this line of code BEFORE <body> and <html> in these 2 files: index_lms.html and story.html. I used Notepad to do this. Be sure to save.
5. I added the same line of code above BETWEEN <body> and <html> in these 4 files: index_lms_flash.html, index_lms_html5.html, story_flash.html, and story_html5.html.
6. I zipped it all back up and sent to my client's Cornerstone administrator to load (this was about the 6th try).
7. Tested the course in Chrome and my music is playing through the entire course. It's also working in IE.
Before hitting Post here, I just went back to make sure I wasn't hallucinating and it still works. Somehow it is possible to make this work, in Cornerstone anyway. Good luck!
Hi,
Does anyone know how to make the audio stop and make it start again in the next slide?
The javascript to make the audio play worked well for me:
var audio = new Audio('myaudio.mp3');
audio.play();
But I don't know the javascript to pause it and play it again.
If anyone knows how to do it I will really appreciate it.
Thanks!
audio.pause();
audio.play();
This post has been really helpful and I was able to get the trick to work when playing on the microsoft Edge browser. It will not work on Chrome and will not work on iphones. Has anyone been able to find a fix to this?
My web files are uploaded to an amazon S3 account and playing from there (again fine on edge, no volume on chrome or iphone).
I don't believe the mobile player (iphone) supports javascript and Chrome's last security update requires a user to interact with a page before media will play. You can get around this by triggering your JavaScript to start the music when the user clicks a big "enter course" or "play media" button. *Note that this is a browser security limitation being forced on the media, it is not an Articulate software issue.
I am publishing to an LMS and it publishes fine but I don't hear the audio. Can someone please take a look at my attached test file and see if I did something wrong?
This question was placed 3 years ago. Are there any updates?
Which Question? This thread was active as recent as 21 days ago...
If background audio is now supported in Storyline without tricks...