Playa

Streaming Mp3 Flash Player

Loading

12.mar.2007 Discontinued

I finally decided to have another go at Playa and add some of the features, that people have been mailing me suggestions for. While reworking the script, I came by Soundmanager 2, which basically does what Playa does, but implements a lot of features from the underlying flash engine, which Playa doesn't.
This allows for volume/pan control, and even for extracting id3 information from songs. The Javascript-side API is a lot cleaner from a programmers perspective as well. (Playa was initially hacked together in a hurry, if I must make excuses ...). All in all, I see no reason to redo, what is already done with Soundmanager 2, and therefore I will not continue development of Playa, and I recommend any new users or users who want the extra features to use Soundmanager 2.

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 embed 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://candyscript.com/projects/playa/playa.zip

Copyright

Copyright (C) 2004,2005 Troels Knak-Nielsen <troelskn@gmail.com>
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 :

PlayaDoPlayStop() -> Playa.doPlayStop()
PlayaDoNext() -> Playa.doNext()
PlayaUpdateInterface() -> Playa.updateInterface()
16.aug.2004 First public release. (version 1)
Feeds for this page: updates updates+comments

Comments

  1. Says: 2007-01-08 19:38:31Z
    Great work. I was wondering how to look at the source code for this. When I try and open the flash file in Macromedia Flash 5 it says unexpected file format. Which environment did you develop this in? Thanks in advance.
  2. Says: 2007-01-09 17:51:28Z
    I used flash MX 2004, but I believe the format is for flash 6.
  3. Says: 2007-01-26 05:55:54Z
    2 things. where is documentation to implement this ? and where is the demo ?
  4. Says: 2007-02-20 15:02:10Z
    This is a fantastic piece of code which I am glad I found and I highly recommend taking a look at! Thanks very much Troels for letting us put all your hard work to good use. Cheers!
  5. Says: 2007-02-21 06:20:59Z
    Hot! Wonder how one might add a counter to the script - either visible or invisible - so that I can know how many times each file gets played?
  6. Says: 2007-03-08 22:35:22Z
    Hi ! I just want to know if playa can handle http live streaming from icecast server without having the boring memory overload ? Thank and congratulation for this really nice piece of code :).
  7. Says: 2007-03-08 23:27:10Z
    MD - Appelsap !!!!! Nice to see that again, i do like yo!
  8. Says: 2007-03-11 23:54:47Z
    @Frayde
    Yep, it can play from any http or ftp resource.
  9. Says: 2007-03-24 23:56:55Z
    Hello, This is Mihai from Romania, Bucharest and I just want to thank the person ho made this simple but really cool flash mp3 player.
  10. Says: 2007-04-30 22:53:25Z
    this is a great playa
  11. Says: 2007-05-03 16:51:19Z
    Thanks, nice simple player. Awesome your selection of IDM music for the demo. ;-) -Cris
  12. Says: 2007-05-28 16:22:31Z
    Can you post the entire script for playing a single file using an http address to access the mp3 file or does it require ftp? The instructions for a beginner is a little confusing : (
  13. Says: 2007-06-04 03:05:12Z
    Exactly what I was looking for, thanks so much!
  14. Says: 2007-07-07 15:48:29Z
    what i am looking for is a simple player that plays mp3's right out of an ftp folder.. without a playlist.. just when you upload a new mp3 its automatically added to the player..
  15. Says: 2007-07-16 17:41:10Z

    will change to your flash player soon :P

    PARTY PLAZA PADOVA TEAM!

  16. Says: 2007-07-19 11:36:00Z
    I am not a software expert but still wish to install mp3 player for my community site. Can anybody guide me plz? umeshtmi1@gmail.com Regards
  17. Says: 2007-08-01 15:12:35Z
    stupid joke, a player with no interface and no design using default buttons.
    You all have must been born without brain
    Hope are not many like you guys
  18. Says: 2007-08-07 04:46:53Z
    I want to know how to change the play counter value on a flash standalone player. example: click play once, but it counts it as 2 or whatever. Anyone know how I could do this?
  19. Says: 2007-09-11 07:22:02Z
    Thanks for this, works good! Will you make this tool more advanced in the future? I would like to see a playlist. If it won't be in this tool, I have to go search for something similar and simple as yours (and customizable). Thanks again, great tool!
  20. Says: 2007-09-11 07:28:20Z
    Wait, scrap the last message; A pause/play button would be ideal! The playlist I can create, by just parsing the xml-file. Not a problem. Is it possible to tell the tool to play file 21, for example? 'Cause if I create a playlist and you click a file, it needs to send a call to the Playa to play file x (=numer you clicked). Now that would be ideal! :) Thanks!
  21. Says: 2007-09-26 01:05:48Z
    What songs are these? Some kinda trance? Sounds awesome! haha
  22. Says: 2007-10-10 07:19:13Z
    It seams to be a problem of dead link in the "Credits" section. Very nice website and excellent content.
  23. Says: 2007-11-19 12:16:02Z
    Is there a way to have multiple instances with controls on a single page? [ie: Playa1.doPlay() or Playa.doPlay('playa1') ] I'm doing a basic list of files in a folder and would like to be able to preview files if they are mp3, video or image. Your script would be ideal for my MP3s if only I could get around needing to generate a dynamic XML play list for multiple files which is do-able, but annoying and untidy for what I need.
  24. Says: 2008-02-05 01:58:17Z
    I really like the code you wrote for the player, and my hat goes off to you for coding it. I have a link back to the url here on my Playa NOAA Weather Stream Page found here - www.eldoradocountyweather.com/wxradio/index.html ... I see above that some people didn't understand how to get Playa working, so I wrote a simple howto on installing Playa using any MP3 stream, or using wunderground.com NOAA radio MP3 streams. I think many personal web sites would love to install Playa on their sites with a link back to this site included on their pages. The HowTo on installing Playa is can be found here - http://www.eldoradocountyweather.com/wxradio/playa-install/playa-howto.html Danny
  25. Says: 2008-03-16 00:45:12Z
    does this player have the ability to play mp3 streams? info@dubradiopr.com

Post Comment




HTML markup allowed in comments. All comments are moderated before posted on the website.