Re: MP3DefaultOperation

Tim Wunder <[email protected]> Fri, 07 Jun 2002 14:11:50 -0400
Newsgroups gmane.comp.apache.mod-mp3
Message-ID <[email protected]>
On 6/7/2002 10:11 AM, someone claiming to be Disnard, Jon wrote:
> Howdy,
> 
> Just in case anybody is not aware.... You don't actually need to use the
> MP3DefaultOperation directive at all. If omitted, you get a built-in default
> to 'play', and that is fine for most people. In fact, I have seen more
> problems created by people using the MP3DefaultOperation directive. 
> 
> There is a few reasons the directive exist, but not for what many folks use
> it for. Before I go further, let me explain that two programs are used with
> mod_mp3: web browsers, and mp3 decoders. The two programs present themselves
> different to Apache/Mod_mp3 when building the initial http connection. I'm
> referring to the USER-AGENT tag the client program sends to the http server.
> WinAMP, for example, does not contain the word 'mozila' anywhere in the
> header it sends to Apache, where the Mozila web browser (IE too) does.
> Another difference is the mp3 player, XMMS for example, expects the initial
> http request phase to be followed by a stream of audio/mpeg data(or .pls, or
> .m3u); where a web browser expects to see anything from plain-text to html.
> This is all dependent on mime types. Anyways... The reason the default
> operation exist is because you can make mod_mp3 output both text/html or
> audio depending on what you want to do. The bad part is that mod_mp3 is
> stupid (no offence krow), and doesn't know the difference between the
> USER-AGENT's. So that is why Krow (aka Brian Aker) created the default
> operation thingy, mainly for interface developers I'd say. 
> 

OK. If I remove the MP3DefaultOperation directive, when accessing via Netscape 4.79 or Mozilla 1.1- (a nightly trunk build, not on the 1.0x branch -- if that matters) from Win2K SP1, I am asked to open or save a file. When I choose to open with Winamp, Mozilla proceeds to download a temp file named <something>.mp3 -- which I assume is the entire MP3 collection chosen to serve -- and not an audio stream. 

With the directive, I am presented a list of audio files from which to choose. If I select some and press Submit, the same thing happens, except the <something>.mp3 file comprises only the files selected. In order for me to get an audio stream, I need to select the M3U (Version 1) option prior to clicking Submit (Play is selected by default).

> If you attempt to connect XMMS to mod_mp3 when using the MP3DefaultOperation
> set to 'select', you will have problems because mod_mp3 is now sending
> text/html to the mp3 decoder by default. Sending text data thru an mp3
> decoder obviously doesn't work. On the flip side, if you are using Netscape
> browser (or IE), and your browser is not aware of what program to pass off
> audio/mpeg data to(aka Winamp, xmms), it will simply do nothing, or try to
> fall back on plain text. This is a problem for Netscape users, since
> Netscape doesn't ship with any mp3 decoders** (Unix only), it cannot make
> assumptions that there is any media player installed to handle the audio
> data. You have to set this up manually in the Netscape preferences. On IE,
> you actually have to mess with the Operating system mime table so all apps
> know who to send mp3 data to, or IE will just download the data, and ask you
> to save; totally oblivious to the installed mp3 decoder.
> 
> The moral of the story: don't use directives your not going to need, and
> setup your browser so they know to properly handle audio/mpeg data.
> 

So, what am I doing wrong? Is it a server problem, or a client problem? 

> So now you all know... And knowing stuff is good! ;)
> 

Ah, but you're making the bold assumption that I understand WTF you just said. Sure I can read the words and all, but it ain't sunk in...despite the fact that I *really* want to understand how this is s'posed to work...

Regards, 
Tim


<snip>