Background Music Demo
Mar 24, 2015
I made a demo featuring background music that goes through the whole course (doesn't change from slide to slide). The user can chose from four songs to listen to and can adjust the volume, and the song continues playing through every slide and loops when it completes. I've also added instructions on how to make this work to the module.
I don't know whether someone else has already posted something like this (I couldn't find anything), but hey if so here's one more!
-------
I've put together a second demo that shows a different way to do this. This second version performs the same actions as the first one, but without needing to edit the output files every time you publish! It saves a lot of headaches when you need to edit something in the course because now you don't have to drop the music files into the output folder and you dont have to edit the html file every time you publish!
I've also attached the second version .story file. Its called Background_Music_Version_2.story.
If anyone needs help getting either versions of this to work I'm more than happy to assist :)
201 Replies
This post was removed by the author
Hi Jackson
sorry my apologies - here is the source file
You got it, Jane! I was just about to clarify that we were basically just hoping to see the .story file that you work in before you hit the Publish button, and that you should see a small, pinkish-purple "a" icon with your file name where you have saved the file (probably on your C: drive). Glad you got it sorted out! :)
thanks Christie - bit dozy its the middle of the night here is Oz
Thanks Jane!
So firstly, the location variable goes back too far, the current one is:
"C:\Users\Jane\Documents\My Articulate Projects\test background music - Storyline output\story_content\WebObjects"
and all you need for that variable is: story_content\WebObjects\6VUFHlYBLQO
The last bit, the 6VUFHlYBLQO part, can be found in the WebObjects folder after you publish your storyline file. If you ever add any additional songs or change the song that you included in the course you will need to find that folder again and update the variable with the new random string of numbers and letters.
Secondly, the trigger setting the song to start playing is missing. In your case, since it is just a single song, I would just lump that trigger into the same javascript trigger you already have to make it easier.
Use this trigger:
and replace "SONGNAMEHERE.mp3" with the real name of the song. The bold part of the script is the new part and you can add it to your trigger. This should get your music starting when the timeline starts.
Let me know if you run into any more issues! I hope this helps :)
Understandable, Jane -- happens to us all on occasion! And Jackson, you are a wiz as always, so thanks for all of the assistance you have provided! :)
Wow thank you so much for your help Jackson I will try that out asap - cheers and much appreciate your time
Sent from my iPhone
Haha, no problaemo guys :)
Its cool seeing other people using this!
Hi jackson
Couldn't sleep so I got up and tried your solution - I must be missing a step as I couldn't get the music to play, have attached the source file and screen shots of my file locations and web object content and location. hoping you can help thanks Jackson
Hey Jane,
So I have to apologize, there was an error my previous post that stopped your file from working.
This is what I told you to set the variable as: story_content\WebObjects\6VUFHlYBLQO
It should have been this: story_content/WebObjects/6VUFHlYBLQO/
Notice that the slashes are facing the other direction and there is an additional one at the end. I corrected my mistake and your file started working! I attached the working file to this post so you can see this change.
Sorry about that! Let me know if you run into any more snags :)
thanks Jackson working perfectly
Maybe you can sleep now Jane :)
Thanks again Jackson.
Leslie 6am not time to get up now - it was worth it thanks guys
Haha! I know the feeling. Glad you have a great start to your day!!
Hi Jackson
everything working beautifully - just one thing I came across - when I left
the module and then came back into it where I left off I noticed there
wasn't any music!
Is this because we have the Java script on the first slide and so it
doesn't know if I come in at slide 11 to activate the script.
I guess I could put the Java script trigger on every slide or do you know a
quicker way?
Thanks again
Jane
Hi Jackson
just wondered if you had a fix or some script for this issue - when the user moves to a different part of the course via the menu the background music stops. And when the user leaves the course Then returns to the course there is no music.
maybe it's not possible - so close
Jane
Sent from my iPhone
Hi Jane, sorry it took so long to respond:
I had never considered the returning to course or jumping around the menu! I think that the easiest way to get around this is to drop the javascript triggers into the slide master so they run on every slide in the background.
The problem with that though, is that if it runs on every slide then the song will restart every time the trigger fires. BUT I think there is a way around this!
So firstly, any of the javascript triggers you are using should be pasted into every slide master main page that you use in the course. That way no matter where the learner jumps in the music should continue start playing.
Secondly, we're going to need to edit the javascript so that it checks to see if there is already music playing before starting this song. This will help us avoid the problem of the song restarting every time the trigger runs.
You'll want to change this:
To this:
This should check if the audio is playing or not, and if not then it will load the song again.
I haven't tested this yet and unfortunately I can't get around to it until later this week probably, so this is just a theory so far. I hope that it works though! Let me know if there's any problems with this and I can try to help as much as I can.
H
i Jackson
All I can say is you are a GENIUS ! it works thank, you thank you
Jane
*Jane Jordan*
Scooore, glad it ended up working!
I'll update the example files to include this information when I get the chance :)
Great work, Jackson, and thanks so much for helping Jane get to where she needed to go! :)
Hi five to all of the great help you guys give the community - no question is too silly and all questions are answered.
Well done and thank you
Sent from my iPhone
How kind of you to say, Jane, and we think this community is something really special, too! We're so fortunate that everyone generously contributes their various skills and experiences to benefit one another and help everyone succeed... pretty darn cool, if you ask me! :)
Hi Jackson
Just as a side and its not a show stopper, is there any Java script which
would allow the music to pause and restart when the user pauses the button
on the playbar?
Cheers
Jane
Hey Jane,
Unfortunately I don't know of a way to interact with the storyline player in that way. To my knowledge its not possible to really interact too much with the built in play/pause button, seekbar, etc.
Many thanks for the follow-up, Jackson! Hope that answers your question, Jane, or perhaps others could share some insight if they have an idea you could try. :)