Embedded Flash Interface for MP3s

How to Embed a Flash Player in Your Website

Here is a solution that lets you post MP3 files and play them in a browser using an embedded interface. This is a Flash player. You will be able to listen to audio without leaving your page. You can embed the player on your page by adding the following code to your website:

  1. copy the embed code provided below and paste it into your own html page
  2. replace song.mp3 with the path of your own .mp3 file
  3. change autoPlay to "yes" if you want the music track to start automatically once loaded - it is set to start when the viewer clicks on play
  4. you must also upload these .swf and .js files to your server.
  5. your mp3 file, swf file, js file and page containing this code must be in the same folder

<!-- Begin Copy/Paste below but do not include this line-->

<script type="text/javascript" src="swfobject.js"></script>

       

<div id="flashPlayer">

  This text will be replaced by the flash music player.

</div>

<script type="text/javascript">

   var so = new SWFObject("playerSingle.swf", "mymovie", "192", "67", "7", "#FFFFFF");

   so.addVariable("autoPlay", "no");

   so.addVariable("soundPath", "song.mp3");

   so.write("flashPlayer");

</script>

<!-- End Copy/Paste - do not include this in  your code>--

CLICK HERE to download the zip folder containing the code above, .swf file, .js file, and a sample mp3.  

CLICK HERE to see my example of how it works!

References: Flash player compliments of premiumbeat.com