Embed an MP3 File

Instructions on Embedding an MP3 File

First, the following code needs to be added to your site header. We can handle this for you upon request.

Second, here are the four lines you need to add (and modify if necessary) to your desired web page in the location where you want the .mp3 file to appear.

Pay particular attention to Line 1 and Line 3. You will need to modify one or both of these lines.

Line 1:

This line creates a container for the audio file to be embedded inside of. If you want to have more than one audio file embedded into one page, you would use one div for each one, each having a unique id name.

Line 3:

This is the main line to observe. We're calling a function called embedAudioFile() and telling it three things.

  1. The location of the audio file. Tn this case we are telling it that the file is located at: '/audio/audio.mp3'.
  2. The name that you used for the div in Line 1. You shouldn't need to change or adjust these unless you want more than one .mp3 on a single page, in which case each div needs a unique ID.
  3. The final option specifies whether to automatically start the audio file or wait for the user to press play. This can be either 'true' or 'false'. In almost all cases, you will want to have this set to 'false'.

Here is a sample of two embedded .mp3 files on one page. If you have Quicktime installed, the .mp3 file will be played using the Quicktime Plugin. If you don't have Quicktime, Windows Media Player will be used instead.

Here is the code used to create these two players:

Did this help you?

If you require additional assistance, please return to the Knowledge Base and search additional topics. If you still cannot find the help you require, please contact us or submit an online support ticket.

Back to List

Customer Testimonials

Advertising Solutions BBB Business Review
Advertising Solutions are Powered & Made in America
Follow Us
Find Advertising Solutions on Facebook Pages
Find Advertising Solutions on Twitter
Find Advertising Solutions on Google+
Find Advertising Solutions on LinkedIn
Find Advertising Solutions on Alignable - For Local Business Owners
We Accept Credit, Checks & PayPal
Accepted Payment Methods
Recommended Web Technologies
Recommended Website Programming Technologies
Recommended Integrated Solutions
Recommended 3rd Party Application Solutions