HTML Code Instructions for Streaming Audio Music
- To stream audio files using HTML, you must create a special playlist. This can include one audio file or several. First, upload the audio file or files to your website. (If they are not already in MP3 or WMA format, convert them.) It's best to organize these into a folder (for example, /audio) to make them easier to find.
Next, open a text-editing program such as NotePad. Type in the full web address for your audio file or files in the order you want them played. For example:
http://www.yourwebsite.com/audio/Track1.mp3
http://www.yourwebsite.com/audio/Track2.mp3
Now save the playlist file with an M3U extension; for example, as playlist.m3u. Upload the playlist to your website. - There are multiple ways to make your playlist available to web surfers. The easiest is to create a direct link to the M3U file:
<a href="/links/?u=/audio/playlist.m3u" type="audio/mpeg">Stream It</a>
Clicking on this link will allow your website visitors to stream the audio. You can also provide a link for users who wish to download the audio file directly:
<a href="/links/?u=/audio/Track1.mp3">Download It</a> - Firefox users, however, may have trouble with direct links to M3U files. Embedding a media player in your page makes it easier for your files to stream on multiple browsers, as well as making the availability of streaming audio files more apparent. The full code for a media player that will work on multiple browsers is available at "How to Stream Music or Audio from Your Website" in the References section.
Embedding a media player on your web page also allows you to have more control over how the music plays. You can set the music's starting volume and change the size of the player. You can even set the player to automatically start when the page loads, making it obvious to your website viewers that you have audio available for streaming.
Create a Playlist
Link to Streaming Audio Files
Embed a Media Player
Source...