Support Forums

Full Version: Streaming music on website..
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How would I go about embedding some sort of streaming music player on my website, that plays music off of my computer, or a playlist?
You have an MP3 file (a podcast, a song of your band, a lecture) and you want to share it with the visitors of your site. You can just put a link to the MP3 and let people download it or you can include it as an object and let the browser play it with a plug-in like QuickTime (and most of the times also crash the browser). Most people want to preview the audio and not wait until it downloads completely. You can play a partial MP3 file in audio player, but many people aren't aware of that.

But there's another away: a Flash player that allows you to pause and rewind the MP3. It's like an audio version of Google Video or YouTube, with the difference that the file is hosted on your server (or on another server). While there are many solutions based on Flash, this is the one I like the most. It's a modified version of Odeo player, that's used to play podcasts on odeo.com:

Code:
<embed src= "http://www.odeo.com/flash/audio_player_standard_gray.swf" quality="high" width="300" height="52" allowScriptAccess="always" wmode="transparent"  type="application/x-shockwave-flash" flashvars= "valid_sample_rate=true&external_url=[MP3 file address]" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed>

Source: http://googlesystem.blogspot.com/2006/07...bsite.html
Make sure you have a license to redistribute the material.
(01-01-2010, 05:55 AM)Grizzly Wrote: [ -> ]Make sure you have a license to redistribute the material.

That too, you don't want infringment laws coming down on yo ass.
If your worried about copyright infringement you could always embed internet radio that plays the type of music you want. Here's an example:

Code:
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" src="http://205.188.215.229:8008" width="100" height="50" transparentatstart="0" autostart="1" animationatstart="0" showcontrols="true" showaudiocontrols="1" showpositioncontrols="0" autosize="0" showstatusbar="1" displaysize="false"></embed>

If you want the player to be invisible just modify the code around like so

Code:
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" src="http://205.188.215.229:8008" width="1" height="1" transparentatstart="0" autostart="1" animationatstart="0" showcontrols="true" showaudiocontrols="1" showpositioncontrols="0" autosize="0" showstatusbar="1" displaysize="false"></embed>

If you don't want the music to play automatically change the "autostart" value to "0"

Code:
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" src="http://205.188.215.229:8008" width="100" height="50" transparentatstart="0" autostart="0" animationatstart="0" showcontrols="true" showaudiocontrols="1" showpositioncontrols="0" autosize="0" showstatusbar="1" displaysize="false"></embed>

Search for a station that plays the music you want, and edit the "src"

Example:

<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" src="http://205.188.215.225:8002" width="100" height="50" transparentatstart="0" autostart="1" animationatstart="0" showcontrols="true" showaudiocontrols="1" showpositioncontrols="0" autosize="0" showstatusbar="1" displaysize="false"></embed>

I think you can also make your own playlist on last.fm, & stream that to your website. I don't think it's copyright infringement if it's playing on the radio.

www.last.fm/
You have to have permission from the radio site to do it.
You can always play music from free websites like http://www.jamendo.com/en/
I got the licensing part under control.

A software I was playing recently was peercast. http://www.peercast.org/

Setting it up confuses me :/ I think once I set the server properly on my computer, I could use Agent's way or embedding on to a website..
I was talking about licensing for using the music.
you can also use some type of flash music player and embeed the code to your site!!