Streaming Mp3 Flash Player

Loading

12.sep.2005 Update

I have cleaned the code up a bit. At the same time I removed the dependency on the RegExp class which was introduced with the last release. This decreases the filesize a bit and should also improve performance a bit.
Apart from cleaning up the actionscript code, I also made some changes to the javascript api. The old function Playa.updateInterface have been removed and replaced with Playa.onStateChange. Note that the parameters are no longer passed to the function as an argument. Instead you can access the property this to retrieve information. Also the behavior have have changed a bit - Playa.onStateChange is only called whenever something changed, while the Playa.updateInterface was called five times a second.
You should also note that the default implementation of Playa.updateInterface has been removed - You'll have to declare it yourself. Have a look at the demo to see how.
At the same time, I introduced two new events Playa.onPlayStop and Playa.onPlayStart, which can be used in the same manner.

What ?

playa is a streaming mp3 player that you can embed into your webpage
to offer backing music.

Why ?

I recently needed a simple mp3-player to imbed into a clients webpage.
After hours of searching, all i found was a commercial component (wimpy),
and a load of realy ugly players that didn't fit into the design.

I eventualy found googlerank's free player, but it was just a tad
too simple (I needed a playlist), so i made playa.

In the event that anybody else should come in need of a free player,
I hereby release playa as free software under the terms of LGPL.

How ?

This little critter use a flash-object for playing mp3's, but
leaves the handling of the gui to html/javascript.
This makes it extremely easy to tailor the appearence to your
needs.
You will need some basic html-skills to tamper with the appearence,
and you will need some of the same skills to edit the playlist (which
is in xml-format).

Hint !

On some platforms, playa only works if you use relative url's for the
playlist. So instead of
playlist=http://localhost/playa/appelsap.xml
use playlist=appelsap.xml

Where ?

You may download source + executable from :
http://www.kyberfabrikken.dk/opensource/playa/playa.zip

Copyright

Copyright (C) 2004,2005 Troels Knak-Nielsen

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation;
version 2.1 of the License.

Credits

The music playing in the demo is made by Mellow-d
http://www.fm.org/appelsap/

You can use the linkbutton below to help promoting playa.
The link-button has been contributed by humaneasy@gmail.com

Powered by Playa

History

12.sep.2005 Update Code cleanup (version 1.5)

I have cleaned the code up a bit. At the same time I removed the
dependency on the RegExp class which was introduced with the last release.
This decreases the filesize a bit and should also improve performance a bit.

Apart from cleaning up the actionscript code, I also made some changes to the
javascript api. The old function Playa.updateInterface have been
removed and replaced with Playa.onStateChange. Note that the parameters
are no longer passed to the function as an argument. Instead you can access
the property this to retrieve information. Also the behavior have
have changed a bit - Playa.onStateChange is only called whenever
something changed, while the Playa.updateInterface was called
five times a second.

You should also note that the default implementation of Playa.updateInterface
has been removed - You'll have to declare it yourself. Have a look at the demo to see how.

At the same time, I introduced two new events Playa.onPlayStop
and Playa.onPlayStart, which can be used in the same manner.

7.sep.2005 Update Added features (version 1.4)
Some updates per request. I have added two new methods ; Playa.doPlayUrl(sUrl)
plays a file with any url. In case you want to manage the playlist from javascript.
To make this work, you will have to set urlfile in flashvars (And remove
playlist).
Playa.doJump(nIndex) can be used to jump to a specific position in the playlist.

I've also added an optional parameter to flashvars. If you set loopsong to true,
the song will repeat rather than automatically jump to the next position.

The update relies on an RegExp engine, provided by : http://www.jurjans.lv/flash/RegExp.html
11.jul.2005 Added features. (version 1.3)
A minor update today. I have added the method Playa.doPrev()
which obviously does the opposite of Playa.doNext().
This has been requested a couple of times, but I haven't gotten
around to implement it till now.

I have also added a linkbutton which you may use, if you want to link
back to playa.
The button has been contributed by humaneasy@gmail.com - thanks.
7.feb.2005 Added features. (version 1.2)
By request, I added the option to play a single file in lieu of a playlist.
This is useful if you need to play a single stream (such as netradio) and
don't want the hassle of creating a playlist.
To play a single file, replace the playlist parameter with
a urlfile parameter, that should point to a mp3-file.
Example :
<param name="flashvars" value="autoplay=true&urlfile=ftp://ftp.scene.org/pub/music/artists/mellow-d/mp3/md-appelsap-6-128.mp3">
...
flashvars="autoplay=true&urlfile=ftp://ftp.scene.org/pub/music/artists/mellow-d/mp3/md-appelsap-6-128.mp3"
I also added two new methods Playa.doPlay() and Playa.doStop()
that may be used in place of Playa.doPlayStop()
22.dec.2004 Bugfix. (version 1.1)
There was a bug in the first release, that caused the buttonlabels to
not update properly under some circumstances. This has been fixed.
At the same time, I cleaned up the javascript code a bit - All code is
now contained in the Playa namespace. To updgrade your existing
code to work with the new 1.1, change the following calls :
16.aug.2004 First public release. (version 1)