background music

background music

by Aviva Wasser -
Number of replies: 13

How can I add background music to a section of a course?  I am using version 2.5

Average of ratings: -
In reply to Aviva Wasser

Re: background music

by amit gupta -

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

In reply to amit gupta

Re: background music

by Richard Palmer -

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

In reply to amit gupta

Re: background music

by Aviva Wasser -

I don't understand the computer jargon. What is the HTML audio tag with autoplay and loop attributes?

In reply to amit gupta

Re: background music

by Steve Ambro v3.8 -

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.

 

In reply to Aviva Wasser

Re: background music

by Guillermo Madero -

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>
In reply to Guillermo Madero

Re: background music

by John Gifford -

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') wink

In reply to John Gifford

Re: background music

by Mark Whitington -

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.

In reply to Mark Whitington

Re: background music

by Steve Ambro v3.8 -

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>

In reply to Steve Ambro v3.8

Re: background music

by Mark Whitington -

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.

In reply to Mark Whitington

Re: background music

by Steve Ambro v3.8 -

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?

 

In reply to Steve Ambro v3.8

Re: background music

by Christian Herman -

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.

In reply to Christian Herman

Re: background music

by Steve Ambro v3.8 -

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....

 

Average of ratings: Useful (1)