One small thing you might want to take into account here...  I don't
know how many users you're planning on supporting w/ the script, but
ColdFusion does have a limited number of threads per server.

They way you're doing it now -- creating the streaming metafile w/ CF
and allowing their MP3 player to grab the file from the webserver
without involving CF -- is okay.  If you went ahead with your plans to
eliminate the webserver mapping, you'd be in trouble.  Since playing an
MP3 obviously takes some time (the length of the song), your users would
be connected to your CF server and consuming one of your precious worker
threads the entire time they're playing.  God forbid they hit 'Pause'
and walked away from their machine!

Also, if your CF Server has a max execution time out set (and it
should!), then your users would only be able to play the song for as
long as the time out value.  After that, the server would drop the
connection, drop a log entry in your server.log, and free up the thread.

In short, CF probably isn't the best solution for streaming MP3's.  You
should probably look into the ShoutCAST server protocol.  Poke around
Winamp.com, and I'm fairly certain you'll find GPL'd freeware to act as
an MP3 server.


Now...  If you *really* want to stream the files directly from your CF
server, it would look something like this:


<!--- GetMeta.cfm: --->
<cfsetting enablecfoutputonly="yes">
<CFCONTENT TYPE="audio/x-mpegurl"><cfoutput>#EXTM3U
#EXTINF:-1,#title#
http://my.server/GetStream.cfm?File=#StreamFile#
</cfoutput>


<!--- GetStream.cfm: --->
<cfsetting enablecfoutputonly="yes">
<!--- I'm just guessing on the MIME type for this one.  You'd better
double check me... --->
<CFCONTENT TYPE="audio/x-mp3" file="D:\MP3\#StreamFile#"
deletefile="No">


But like I said...  Don't do it that way.  Your server would be brought
to its knees!

Best regards,
Zac Bedell

> -----Original Message-----
> From: Rich Z [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, June 04, 2001 11:19 PM
> To: CF-Talk
> Subject: Sending MP3's Through CF
> 
> 
> I figured out a way to send mp3's through a web server on 
> demand (pseudo-streaming by using CFCONTENT w/ a mime-type of 
> audio/mpegurl. The page that does the sending looks like this:
>  
> <CFCONTENT TYPE="audio/x-mpegurl">
> <cfoutput>
> #EXTM3U
> #EXTINF:-1,#title#
> http://my.server/mp3/#streamurl#
> </cfoutput>
>  
> My question: I'd like to still do the above without mapping 
> my mp3 folder on the web server and referring to my own 
> server. As it is - people can snoop around the /mp3 folder on 
> the web server. Any suggestions on how to get around this?
>  
> Thanks,
> Rich
> 
> 
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to