Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Embed MP3 stream player?
2 points by yeti on April 26, 2010 | hide | past | favorite | 4 comments
I make a chat website, and I'd like to add music streaming to the user chatrooms.

ie - the chatroom host can enter in a URL of a streaming MP3 and then everyone in the chatroom hears that stream - the music files are not stored on our servers, but just browser client to another URL

Any suggestions?



Soundmanager2 [1] is widely used, and I've used it myself in a couple of projects.

It may be a bit to full-featured for the small thing you are trying to accomplish but you can customize it quite a bit.

You can just listen for mp3 links in the chatroom and queue it up in soundmanager.

[1] http://www.schillmania.com/projects/soundmanager2/


Doesn't flash have a same origin policy that would prevent you from streaming mp3s from random URLS. I thought you have to host both the player and mp3 at the same domain? Or at least have a policy file on both domains that says you can access it. I could be mistaken, but this is how I remember it from the last time I checked.


Flash can load MP3s from remote domains, but it cannot read certain metadata (eg. ID3 tags, waveform/eq/spectrum data) unless granted permissions via a crossdomain.xml policy file. For hosting, the SWF should be on the same domain as the HTML document or JS-Flash communication will be restricted (or, use the cross-domain version of the SWF.)


Thanks Schill, can it load MP3 streams as well as MP3 files? Assume so, but just to check. Any suggestion on player?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: