EASY WAY TO IMPLEMENT A STREAMING AUDIO FILE USING M3U PLAYLIST FILE:
Note: This tutorial does not cover the creation of an MP3 file. It assumes you already have one ready to post to your site. (My choice for this page: short music clip of "Shades of Gray" performed by the Monkees March 1967 - 109 seconds copyright info)
This technique requires 2 files: a playlist file, and a sound file (mp3)
1. Using
FTP Software
, upload your MP3 file to a folder on your website. If you plan on having several mp3 files for your website, you can set up a folder specifically to hold them (I created a folder called sounds to hold my wav and mp3 files).
2. Test your URL for the mp3 file that you want to use to make sure you have it correct. (My site address is http://www.samisite.com and the sounds are in the sound folder. So to get to the sound I want to use on this page the address is http://www.samisite.com/sound/thefilename.mp3)
3. Make a playlist file. Open NotePad (installed on all Windows machines), or any other text program. Paste the URL to your mp3 song into the text file then save the file as "filename.m3u".
File Name: shades.m3u and the only thing in the file is this address to the sound I want to play:
http://www.samisite.com/sound/cropShadesofGrayMonkees.mp3
|
PROBLEM - STRONG WARNING: If your visitor saves a m3u file to their computer they get the URL addresses of the mp3 songs, not the songs themselves. That's fine. But, they could use the m3u file with their media player to link to your music files on the web, drawing from your website bandwidth allotment, even if they are not visiting your website! Web hosts only allow you a certain amount of transfer so you must guard it.
SIMPLE FIX: If you use relative linking, you can keep people from accidentally accessing your music files from their desktop. In order to access the sound file stored on your website, they must manually change the m3u file before using it! Those folks can be identified and stopped from doing so.
This is an absolute link: http://www.samisite.com/sound/cropShadesofGrayMonkees.mp3
It has the full website URL included. Using it in your m3u file could cause your visitor to play your music without visiting your website.
Change it to a relative link before you upload the m3u file to your website.
Remove your website domain from the link: http://www.samisite.com/sound/cropShadesofGrayMonkees.mp3
so the relative link becomes: /sound/cropShadesofGrayMonkees.mp3
The / at the front tells the browser to go to the main directory of the website you are visiting.
sound is the directory stored in the main area of the site (yours could be different)
and the rest is the music/sound file name.
My final file: shades.m3u and the only thing in the file is this address to the sound I want to play:
/sound/cropShadesofGrayMonkees.mp3
|
How this fix works: If playing sound while visiting the website, the sound file can be played. If playing from a desktop, the WEBSITE domain is missing so the media player can NOT connect to your website URL to play the file!
Try it yourself: Right click this link and choose SAVE TARGET AS and you can download the m3u file to your computer desktop. Once downloaded, you can double click the file to try to play it from your desktop. Your media player will try to locate the music listed in the file, but will not be able to do it!
IMPORTANT: BE CAREFUL HOW YOU TYPE YOUR FILE NAMES. No spaces, characters (other than dash - or underline _. CaPS and LOwerCAsE do make a difference on MANY servers!!! myfile.mp3 and MyFile.mp3 is not the same file on some servers!
|