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.
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.
This is the main line to observe. We're calling a function called embedAudioFile() and telling it three things.
- The location of the audio file. Tn this case we are telling it that the file is located at: '/audio/audio.mp3'.
- 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.
- 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.
1. A place, or territory, on the internet; a developed piece of internet real estate; a website application. 2. An interactive advertising business solutions company.