Make sure this is placed somewhere inside the <body> tags, but outside any <script> tags.
The other things go into an "Execute JavaScript" Trigger that you can start when the first slide's timeline begins (or wherever / however you want to execute the trigger).
var audio = document.getElementByld(‘bgSong’); audio.src=”Recorded1.mp3"; audio.volume = 0.6; audio.load(); audio.play();
NOTE: You want the "" to enclose the whole song name including the file extension
Ive included an example story file as well as a zip file that contains the WEB output of that example so you can see the HTML file and how its set up. I hope this helps!
Even though I installed Storyline 1 update 8 and activated my account, the story file above cannot open displaying a dialog box stating it should be a newer version of Storyline.
The problem is still on despite having restarted Windows.
Jackson - THANK YOU for posting this! I just tried it and after I remembered to put the audio file in the same level folder as the HTML file, it worked!
Yes, it looks like Jackson's file is an SL2 file, and therefore unable to be opened in SL1. I'm not sure if he's able to share an example within SL1, but hopefully he'll chime back in this thread and let us know.
Yes, it looks like Jackson's file is an SL2 file, and therefore unable to be opened in SL1. I'm not sure if he's able to share an example within SL1, but hopefully he'll chime back in this thread and let us know.
Unfortunately I do not have Storyline 1, only 2 :(
You can't convert a SL2 file to SL1 as it's not backwards compatible. But you could download the a copy of SL1 here to recreate the behavior there if you'd like.
Please see herewith the screencast of the html’s notepad sections.
Could you choose one in which the code <audio src=”” id=”bgSong” preload=”auto” autoplay loop></audio> should be inserted and arrow to the line with a bold marker?
Also could you post in this thread screencast(s) of the dialog box of “Execute Java” trigger?
No problem! I can't do a screencast at the moment unfortunently, but I can try to go through it with screenshots!
So first, this is the line where you should insert the line in the html file.
There are technically a few other places you can put it in the file, but I always drop it there.
Remember that whenever you re-publish your story file you will need to go through and re-insert this line into the html file because every time you publish your course it overwrites that line.
The JavaScript is this:
Then you publish, add that line to the HTML file, drop your song into the output folder and launch the course!
It should start playing automatically, if it isn't make sure your browser isn't blocking the JavaScript. You may need to click the "allow blocked content" button or something like that if it pops up.
When I did put the music in, it only worked in Firefox, not IE. Also, I had to be sure when I published it that I checked all the options to include html 5 in the publish settings or it would not play on another computer although it worked on mine.
Just a note regarding browsers and your output - you'll want to confirm that you're using one of the supported browsers detailed here for viewing content, and IE is not supported for viewing HTML5 output.
33 Replies
Hi Kaan!
Sounds like this thread may be able to assist you.
Otherwise, hopefully someone in the community will be able to assist you.
I keep on failing to do it.
Is there any advice?
Kaan
I made a demo for this here.
Can you post the code or story files?
Hi Kaan,
It's not something supported in Storyline, so it's a custom set up that we'd defer to the community to assist you with.
Best of luck with your project!
Hi Jackson,
Few days ago, I already tried by inserting the codes of your thread in the notepad of the html page with the output folder and failed.
Can the reason be that ITunes and Media Player asked to install when I tried to run the mp3 file separately?
The recent codes I tried by inserting at the end of notepad are below:
<DIV id='divWebObjects'></DIV>
<audio src=””id=”bgSong” preload=”auto” autoplay loop></audio>
var audio = document.getElementByld(‘bgSong’);
audio.src=”Recorded1”.mp3;
audio.load();
audio.play();
var audio = document.getElementByld(‘bgSong’);
audio.volume = 0.6;
</body>
</html>
I also dropped the mp3 file in the output folder.
Regards,
Kaan
All that you need to put into your HTML file is:
Make sure this is placed somewhere inside the <body> tags, but outside any <script> tags.
The other things go into an "Execute JavaScript" Trigger that you can start when the first slide's timeline begins (or wherever / however you want to execute the trigger).
NOTE: You want the "" to enclose the whole song name including the file extension
Ive included an example story file as well as a zip file that contains the WEB output of that example so you can see the HTML file and how its set up. I hope this helps!
Thanks Jackson for coming back around.
I added another comment about it to the other thread, it might help in case you were looking to just work with a single song.
I saw that Jackson, thanks for sharing :)
Hi Jackson,
I shall examine your enclosed files above and return to this thread to tell of the outcome.
thank you very much
Kaan
Even though I installed Storyline 1 update 8 and activated my account, the story file above cannot open displaying a dialog box stating it should be a newer version of Storyline.
The problem is still on despite having restarted Windows.
How can I fix?
Kaan
Hi Kaan
the file you are trying to open maybe a Sl2 file which cannot be opened in SL1
Hi,
Jackson - THANK YOU for posting this! I just tried it and after I remembered to put the audio file in the same level folder as the HTML file, it worked!
Thanks!!
Hi Kaan,
Yes, it looks like Jackson's file is an SL2 file, and therefore unable to be opened in SL1. I'm not sure if he's able to share an example within SL1, but hopefully he'll chime back in this thread and let us know.
Can I ask one additional question? Is it possible to have an album (or playlist) play as background music instead of only one song?
Unfortunately I do not have Storyline 1, only 2 :(
Is there a way I can convert it to a SL1 file?
Working on figuring this out right now, will post results when I find an answer!
You can't convert a SL2 file to SL1 as it's not backwards compatible. But you could download the a copy of SL1 here to recreate the behavior there if you'd like.
Hi Jackson,
I’m still failing.
Please see herewith the screencast of the html’s notepad sections.
Could you choose one in which the code <audio src=”” id=”bgSong” preload=”auto” autoplay loop></audio> should be inserted and arrow to the line with a bold marker?
Also could you post in this thread screencast(s) of the dialog box of “Execute Java” trigger?
Thank you very much in advance,
Kaan
No problem! I can't do a screencast at the moment unfortunently, but I can try to go through it with screenshots!
So first, this is the line where you should insert the line in the html file.
There are technically a few other places you can put it in the file, but I always drop it there.
Remember that whenever you re-publish your story file you will need to go through and re-insert this line into the html file because every time you publish your course it overwrites that line.
The JavaScript is this:
Then you publish, add that line to the HTML file, drop your song into the output folder and launch the course!
It should start playing automatically, if it isn't make sure your browser isn't blocking the JavaScript. You may need to click the "allow blocked content" button or something like that if it pops up.
Jackson,
I ticked the button for allowed blocked content in IE. However, no song from my presentation.
Can the reason be that I need to update to the recent version of Java?
Kaan
Hmmm I don't think that should be the problem... Maybe try updating it just in case?
Would you be willing to share your .story file here so I can see how you have it set up?
Hi - just wanted to add a quick note.
When I did put the music in, it only worked in Firefox, not IE. Also, I had to be sure when I published it that I checked all the options to include html 5 in the publish settings or it would not play on another computer although it worked on mine.
Hi Amanda,
Just a note regarding browsers and your output - you'll want to confirm that you're using one of the supported browsers detailed here for viewing content, and IE is not supported for viewing HTML5 output.
Hi Ashely,
I understand that but without those checked, the music would not play using Firefox on someone else's computer. The file played w/o issue on both.
This discussion is closed. You can start a new discussion or contact Articulate Support.