Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Streaming audio using m3u playlist file

Status
Not open for further replies.

bkoopers

IS-IT--Management
Apr 26, 2005
86
US
I created a webpage with this line of code:

<a href="Scenic-3songs.m3u">(streaming with WinAmp)</a>

The referenced "Scenic-3songs.m3u" file contains this one line:


Here is the webpage:


When I view the webpage in Mozilla Firefox, Netscape or Opera, when I click on the link, it pops up the WinAmp mp3 player and it immediately starts streaming and playing the referenced 11 mb size mp3 file. When I view and click on the link in Internet Explorer (version 6.0), it pops up the WinAmp mp3 player but it does not play the mp3 file.

What code can I use that will stream the mp3 file in Internet Explorer (as well as the other web browsers)?

Thanks to anyone who can help me out.
 
As you've mentioned it yourself, it is the winamp that runs when you click the link. So html has nothing to with all this. Ultimately, if the computer does not have a Winamp (or equivalent program that runs .m3u files), the link will simply not work. So, it must be a WinAmp or IE problem and not in any way an html problem (and thus cannot be solved with html).
 
Since WinAmp does pop up when the link is clicked, that indicates that m3u file type are associated with the WinAmp program on my computer.

If I view that html page by opening the file from my local hard drive (instead of from the website) and then click the link, WinAmp pops up and it immediately starts playing the mp3 file.

I have read in several places on the Internet that the code I am using is the way to stream mp3 files on the Internet.

Does the mp3 play in Internet Explorer if anybody else clicks that link? Please let me know.

If the problem is just on my computer, what can I do to fix it?

Is there a better method for streaming mp3 files on a webpage (so it starts playing immediately instead of waiting until the entire file downloads)?
 
It is an IE problem. It stores the file and then deletes it from the Temporary Internet Files for some reason.

I recommend offering instructions (as I have seen done quite often) to open Winamp and opening the streaming file manually.

Basically, you open Winamp, type Ctrl+L and then paste the URL of the streaming file.
 
As I said, WinAmp does open. There is no need to add instructions to open WinAmp. The problem is that it does not play the mp3. There must be a way to stream an mp3 by just clicking on a link without having to copy and paste the URL. The other web browsers support the technique I used.

Does anyone know another method that works in all browsers (or a method just for Internet Explorer and I can add a separate link just for IE)?
 
Yep, use flash to build a little widget.

I did it here


It's just a little flash movie that plays an MP3 file. The url of the MP3 is passed to the flash movie via a url parameter so you only need 1 flash movie.

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
The real problem is the fact that Internet Explorer deletes the file. The other browsers don't. Opening Winamp isn't the problem. Opening the file (which isn't there when opened) is the problem. In other words, Winamp isn't using your M3U file from your site when it is downloaded in Internet Explorer. It is using the downloaded file that is deleted immediately, rendering Winamp with a non-playable file.

I'm not sure why Internet Explorer does this, but this is why I recommend listing a series of simple steps.

Example -
1) Copy this URL: 2) Open Winamp
3) Type Ctrl+L
4) Click "Open
 
Here is a follow-up:

Please check out this webpage:


I made the second link a "scenicsongs123.m3u" file which contains the path to a "scenicsongs123.mp3" file and the m3u file and the mp3 file have the same name (with no capital letters and no dashes) (but different file types) and they are in the same directory as the html file and I still have the same problem.

Somebody else gave me their m3u file link (the third link on ther webpage) and somebody else tried these m3u links on their Windows XP computer with Internet Explorer and they see that my scenic m3u does not play the mp3 but the Caruso does play the mp3. Since more than one computer has the same problem with my m3u and but not the other m3u (same thing that happens on my computer), it appears the problem is not my computer and not with IE but something wrong with my code. There must be something wrong with either the code in the html file or the m3u file (but I cannot see what).

Can anyone figure out why the Caruso1903.m3u link plays the mp3 in IE but not the Scenic-3songs.m3u (or scenicsongs123.m3u)?
 
YOU CANNOT DO ANYTHING ABOUT IT

It is a problem that exists between IE and Winamp.

It is the way that IE handles it's cached files, sometimes it will add an index No "filename[1]" to identify the file in the index.dat and in the relevant sub-folder in the TIF cache.
If it adds the index number it will fail, when it doesn't it will work correctly.

And the reason I have found this is I'm developing a site for a record producer/DJ and had the same problems with their samples.


Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Or can you? Would the old trick of appending a random parameter to the end of the URL do the trick? Something like:

Code:
<a href="[URL unfurl="true"]http://thefireandreason.irbl.net/audio/Scenic-3songs.m3u"[/URL] onclick="this.href = '[URL unfurl="true"]http://thefireandreason.irbl.net/audio/Scenic-3songs.m3u?randParam='[/URL] + new Date().getTime();">Scenic-3songs.m3u</a>

I've not tried it, but you never know!

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
I added another link to that webpage that trys the "appending a random parameter to the end of the URL " suggestion but I still have the same IE/WinAmp problem (it does not play the mp3 but the other web browsers do).

I tried deleting the temporary Internet files in IE but that made no difference.

Chris: In what directory and file can I look to see if it added an index No "filename[1]" to identify the file in the index.dat and in the relevant sub-folder in the TIF cache? Is there anything I can do in selecting the file name or forcing a cache clearing as a workaround? Have you found another method that works in all music players and all web browsers for streaming mp3 files?

Foamcow: I checked out your flash music player widget. Thanks. Although it would work, I would prefer to use a music player that showed the time progress as it plays like the other music players do. Although I have Flash MX 2004, I am not that familiar with programming in it. Can you please give me the "fla" file to modify or can you refer me to another flash player (with "fla" source code) that has the time length progress indicator?
 
bkoopers
It would be possible to add a time progress bar to the flash movie. However, if I remember correctly mp3 files store the file info at the end of the file. Meaning that you have to read the whole file in order to get the song info, track length etc.
I beleive there is a newer version of the format that stores the track info at the start of the file though (which is much more logical really!.


I will dig out the fla source and post a link here asap.


Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
Ahh I was just going to post about Wimpyplayer.

Basically that flash button I made was an emulation of Wimpybutton. I'm just too tight to pay for stuff like that ;-)

I was also going to suggest about using a server side language to analyse the files available for streaming and store their lengths and other info in some kind of database or flat file. This would mean your player could access info from there to display while streaming the file itself.
I think that's how Wimpyplayer works though I've not looked at it.

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
FoamCow, I do remember that I have made a script reading the mp3 information from the file. While you're right in saying that mp3 ID3v1 was written at the end of the file, it is not true for ID3v2 which has been widely used since it was introduced. ID3v2 is found at the beginning of the file. As for the length of the file, I believe it depends on the encoding:

-- fixed bitrate files have bitrate information written at the beginning of the file (regardless of which ID3 tag they use) and the length is computed with the bitrate and file size
-- variable bitrate files have length written somewhere at the beginning of the file, however I am not sure where.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top