How can I add background music to a section of a course? I am using version 2.5
Hi Aviva,
The HTML5 Audio tag has autoplay and loop attributes which could give you continuously playing background music.
Give it a try and see if t works.
Amit
Hello Amit
I like the idea, however, not knowing what an HTML5 tag is and how to use it I'm stuck. I would be most grateful if you could tell me what to do with it.
Many thanks Rick
I don't understand the computer jargon. What is the HTML audio tag with autoplay and loop attributes?
Maybe if you would post a sample of the code to do this and tell us where in the code it belongs, maybe we could explore it.
This would be the code to add:
<audio src="youraudiofile.mp3" autoplay loop controls>
<p>Your browser does not support the audio element</p>
</audio>
You could also include different audio formats, in case one of them cannot be handled by the browser:
<audio autoplay loop controls> <source src="youraudiofile.mp3" type="audio/mp3"> <source src="youraudiofile.ogg" type="audio/ogg"> <p>Your browser does not support the audio element</p> </audio>
Well I just tried this with a label in a course. It works of sorts...
The label has to be visible to get it to play, make it invisible and only teachers/course creators and admins can get it playing. Students get Simon and Garfunkel ('the sound of silence')
I thought placing the label with the audio in an "orphaned activities" topic section would work... just tried it but if failed.
I also tried closing the eye on the topic section but the activity eye open... it too failed.
Where did you place the audio file? I have mine on a remote server and amusing a URL to call it.
Here is the code I am using to test. You are free to try it. It works as an executable HTML file but I cannot seem to get it to work in Moodle. Maybe it is in the wrong place. I tried it as an assignment, a label, and a few other places.
Maybe someone here can tell me where to put it.
===============================================
<audio autoplay loop controls>
<source src="Http://www.ambrofiles.me/GeneralAudio/ChatBots.mp3" type="audio/mp2">
<source src="Http://www.ambrofiles.me/GeneralAudio/ChatBots.mp3" type="audio/ogg">
<p> Your browser does not support the audio file</p>
</audio>
I used "insert Moodle media" within a label etc.
When the label was in a visible topic it auto-plays as intended but the "player" was visible.
I thought the intention was to not show the media player, hence using the orphaned area... this seems to break its ability to play.
I guess I am just not seeing it. I open new label but do not see "Insert Moodle Media".
I am using 2.5.1, could that be the problem?
Assuming you have the text editor turned on:
If you don't see that icon then it may be disabled. Check the status of the plugin at Site Admin > Plugins > Text Editors > TinyMCE HTML Editor > General Settings and open eye on moodlemedia if closed.
I finally found the answer, MP3 was was disabled. I had to undisable it.
Also, used no HTML at all. I just placed the URL in the description.
Enjoy the clip[ while you are at it....
Sorry, couldn't resist...