<p>I want to put songs on a web page and have a little play button, like you can see on Last.fm or Pandora. There can be multiple songs listed on the site, and if you start playing a different song with one already playing, it will pause the first track and begin playing the one you just clicked on. I think they use Flash for this, and I could probably implement it in a few hours, but is there already code I could use for this? Maybe just a flash swf file that you stick hidden on a web page with a basic Javascript API that I can use to stream mp3 files?</p>

<p>Also, what about WMA or AAC files? Is there a universal solution that will play these 3 file types?</p>

<hr>

<p><a href="http://musicplayer.sourceforge.net/" rel="nofollow noreferrer">http://musicplayer.sourceforge.net/</a></p>

[{'answer_id': 48231, 'author': 'Sean', 'author_id': 4919, 'author_profile': 'https://Stackoverflow.com/users/4919', 'pm_score': 1, 'selected': False, 'text': '<p>There are <strong>many</strong> flash mp3 players that you can use that do this. Usually, you just have to edit a text file to point at the mp3s you want to have available.</p>\n\n<p>Here is the first one that showed up on a google search for <code>flash mp3 player</code>: <a href="http://www.flashmp3player.org/demo.html" rel="nofollow noreferrer">http://www.flashmp3player.org/demo.html</a></p>\n'}, {'answer_id': 48368, 'author': 'UnkwnTech', 'author_id': 115, 'author_profile': 'https://Stackoverflow.com/users/115', 'pm_score': 0, 'selected': False, 'text': '<p>This is fairly simple if you want to embed the WMP you can use all the controls via JavaScript. There is a great MSDN section on it but I cant seem to find it now.<br /><br />Edit: I found <a href="http://msdn.microsoft.com/en-us/library/ms909930.aspx" rel="nofollow noreferrer">this</a> on MSDN it contains the properties that an embeded WMP will accept then all you have to do is call the methods via javascript.</p>\n\n<pre><code>&lt;OBJECT id="VIDEO" width="320" height="240" \n    style="position:absolute; left:0;top:0;"\n    CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"\n    type="application/x-oleobject"&gt;\n\n    &lt;PARAM NAME="URL" VALUE="your file or url"&gt;\n    &lt;PARAM NAME="SendPlayStateChangeEvents" VALUE="True"&gt;\n    &lt;PARAM NAME="AutoStart" VALUE="True"&gt;\n    &lt;PARAM name="uiMode" value="none"&gt;\n    &lt;PARAM name="PlayCount" value="9999"&gt;\n&lt;/OBJECT&gt;\n</code></pre>\n\n<p>Then for the javascript</p>\n\n<pre><code>&lt;script type="javascript"&gt;\nobj = document.getElementById("VIDEO"); //Where video is the id of the object above.\nobj.URL="filename"; //You can use this to both start and change the current file.\nobj.controls.stop(); //Will stop\nobj.controls.Pause(); //Pause\n&lt;/script&gt;\n</code></pre>\n\n<p>Somewhere around here I have code to even control the volume.<br />\nA while ago I built a custom (looking) player for a client purely in HTML and JavaScript.</p>\n'}, {'answer_id': 48395, 'author': 'knuton', 'author_id': 4991, 'author_profile': 'https://Stackoverflow.com/users/4991', 'pm_score': 0, 'selected': False, 'text': '<p>Something I bookmarked long ago, but never got to test so far: <a href="http://www.schillmania.com/projects/soundmanager2/" rel="nofollow noreferrer">http://www.schillmania.com/projects/soundmanager2/</a></p>\n'}, {'answer_id': 48600, 'author': 'Grey Panther', 'author_id': 1265, 'author_profile': 'https://Stackoverflow.com/users/1265', 'pm_score': 0, 'selected': False, 'text': "<p>I second superjoe30's suggestion: I had great success with musicplayer. The only (slight) negative is that it's a little older project and not as well skinnable as some of the alternatives (although you have the full source code, so - given some time - you can make it look exactly as you need it to).</p>\n"}]
['https://Stackoverflow.com/questions/48225', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/432/']