InfoQ

News

Playr 2.0: And the Best Goes On

Posted by Moxie Zhang on Feb 25, 2009

Community
Java
Topics
Rich Internet Apps
Tags
ActionScript

Compared with traditional application development technologies, one important aspect of rich Internet applications (RIAs) is the ease of handling media rich contents. The Playr ActionScript 3 music library is one example that helps Flash, Flex or AIR based applications easily incorporate music contents. InfoQ spoke with the Playr creator Ronny Welter for more insight.

Welter, a young Flash developer who lives in Belgium, is the Chairman of FlashFocus.nl. He describes how Playr was born of his many deadline crunching projects:

I was working on a project, for which I needed a music player that could handle different playlists. I figured this is Flash! I ran a quick search on the Web, only to find there was no library out there that did what I really needed. Since I was in a hurry, I created what I needed. Later, I released the class—only to get bug reports and lots of feature requests. Initially, it was called 'MusicPlayer'. When the first decent ActionScript 3 version was released, I named it Playr.

Playr makes building any kind of music player in Flash/Flex a piece of cake: easy, straight forward and quick! Playr can handle the needs for anything from a single track or a loop to a full-feature music player.

According to Welter, Playr is designed a bit like a model view controller (MVC) application that enables you to create the view and add the model and the controller in a way it fits your needs. He says:

I added register functions to make sure you could wire the handlers to the desired control in a simple way. However, if you prefer hooking everything up yourself, using event listeners, knock yourself out. There is an event for almost everything in there. This should enable everyone to accomplish whatever they want.

With respect to the challenges encountered during the development of Playr, Welter shares:

Playr was supposed to make everything easier. Therefore, building a library that is flexible, yet stays easy to use, was probably the most difficult part. Keeping it all that simple and getting Playr shaped up the way I wanted really gave me a headache sometimes. One thing that still doesn't fit right is the de duration of the track. Right now, you have to pass this value along (in seconds) using XML or a few features will not work. The ID3 tag gives you the length of the track only for the part that has been loaded. For example: if you've got a track of 240 seconds that has only been loaded halfway, ActionScript will return 120 seconds for the length property of the sound. In other words, it gives the buffered part of the track. I've tried all kinds of stuff, but I can't get the correct length right, so I'll just stick with the XML until I get this right.

As for future plans, Welter tells InfoQ:

I've got lots of ideas for Playr. I'm looking into new features, such as cross fading, Last.fm API integration, sound distortion and effects, and so forth. Right now, there is a PHP implementation of something called PlayrDiscovr. PlayrDiscovr is the automated playlist that saves time. The latest PlayrDiscovr version was written by Ward Werbrouck. I'm looking for people willing to write ASP, Ruby, ColdFusion and Python implementations for PlayrDiscovr.

I'm also working on a Visualizr class to add all kinds of sound visualizations. This isn't Playr-only, but it should be as easy to use as Playr itself.

Here are some music projects that use Playr:

http://playr.nocreativity.com/look/singletrack/

http://playr.nocreativity.com/look/fullblown/

http://walterego.be

http://tarasnovak.com/blog/2009/01/15/flex-music-player-v2/

http://guusdegraeve.be/schoolwork/transformers/

No comments

Watch Thread Reply

Educational Content

The Power of Visibility: Driving a Lean-Agile Transition

Kelley Horton discusses the reasons why her organization transitioned to Lean-Agile, the approach used and the visual tools helping them minimize WIP, concluding that visibility leads to success.

Panel: Modular Java

Alex Blewitt, Kevin Seal and Alex Buckley answer Java modularity-related questions: when is modularity needed, how to address it, and what are the improvements in OSGi-based development.

Whither the Smartphone? Future Directions in Smartphones and Mobile Development

Adam Blum discusses the current trends in mobile development and smartphones, trying to predict what will happen in this area over the next 5 years so a developer would know what to expect.

Cogs in the Machine: Testing Code Embedded in an Impenetrable Framework

Roy Osherove discusses the difficulties met when trying to test code embedded in a framework (cog), presenting several solutions to create unit tests for cogs, using Silverlight code as example.

Confessions of A New Agile Developer

This short article is a first-person case history of someone taking up Agility for the first time. It covers the problems and reactions that are common to most teams and most developers.

Scott Chacon on Git and GitHub

Scott Chacon talks about the technologies that power GitHub (Erlang, Redis,...), and the benefits of Git as a version control and as a storage system. Also: ShowOff, a JS-based presentation tool.

Reformulating the Product Delivery Process

Israel Gat, Erik Huddleston and Stephen Chin present how Inovis realized a higher product throughput by using three unconventional Kanban practices and a Lean Release Management tool called APROPOS.

Enterprise Mashups: Why Do I Care?

Ross Mason discusses how to use enterprise mashups by applying a number of patterns, such as FeedFactory, Super Search, and Pipeline, in order to find new ways to benefit from existing enterprise data