I am working on a greasemonkey script where I want to be able and play mp3 files in the background. The <audio> tag would be a good and easy solution but unfortunately Firefox doesn’t support mp3 playback because of license issues.
I found in the end this simple .swf file here that supports the follow:
- Loop on/off
The problem I faced, as usual, was zero documentation. Although the source code of the mp3 player is available, it was hard for me to decode how to use the player, especially when I am totally unfamiliar with actionscript.
In the end I managed and in fact I made two minimal templates to help out future users.
- Download this package. Alternative links: on 2shared, on speedyshare
- Unpack to your server.
- Browse to index.html or index2.html
As you notice the html code is as simple as this
<button id="playButton">Play</button> <button id="pauseButton">Pause</button> <button id="stopButton">Stop</button> <button id="loopOnButton">Loop On</button> <button id="loopOffButton">Loop Off</button>
the key elements in this segment are the ids. As long as the ids are not changed you are free to change the tag type as you wish. For example
does work as good as the previous code without breaking any functionality.
NOTICE: If controlling the playback doesn’t work once you unzipped, make sure that the files are on your website folder. Launching the .html files directly from a local folder(for example “desktop”) will not work. That is due to security reasons when it comes to flash.
April 4, 2012 at 4:00 pm
Would like to find the package files associated with this blog. Please help if possible.
April 4, 2012 at 5:47 pm
Not sure what you mean.. Would gladly help if you clarified what you want 🙂
November 2, 2012 at 6:47 pm
The download link no longer works…
November 2, 2012 at 8:14 pm
November 2, 2012 at 8:17 pm
December 25, 2012 at 10:03 pm
demo does not work anymore
December 25, 2012 at 10:06 pm
forgot to mention, tested on multiple browsers, two PCs, this one had according to this
flash player 11.5.502.135 on x64 windows
December 26, 2012 at 12:48 am
It does work for me. What exactly is the problem? Did you try to change permissions for the files so everyone can execute them?
December 26, 2012 at 10:55 am
Problem is that I am a moron who though I could just ignore step 2 and play it locally and who just cant be bothered to actually read few words of instructions.
December 26, 2012 at 12:53 am
Tested with 22.214.171.1248. I have no windows machine to test.