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.
playa is a streaming mp3 player that you can embed into your webpage
to offer backing music.
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.
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).
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
You may download source + executable from :
http://www.kyberfabrikken.dk/opensource/playa/playa.zip
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.
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
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.
Playa.doPlayUrl(sUrl)
urlfile
in flashvars (And remove
playlist
).
Playa.doJump(nIndex)
can be used to jump to a specific position in the
playlist.
loopsong
to true,
Playa.doPrev()
Playa.doNext()
.
playlist
parameter with
urlfile
parameter, that should point to a mp3-file.
<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"
Playa.doPlay()
and Playa.doStop()
Playa.doPlayStop()
Playa
namespace. To updgrade your existing
PlayaDoPlayStop() -> Playa.doPlayStop()
PlayaDoNext() -> Playa.doNext()
PlayaUpdateInterface() -> Playa.updateInterface()