Apollo Music Player

,

If you haven’t checked out Adobe Apollo on Adobe Labs yet, what are you waiting for? Apollo is a platform-independent runtime system. Apollo applications can mix Flash, HTML, and PDF content all in one application.

If you download the Apollo alpha trial you’ll find some great examples. I decided to try my own hand at an Apollo application and created a music player. There is a music application on the Apollo Showcase site, but there’s nothing like writing your app to get a feel for how things work.

You can rip your CDs into a special directory ({documents}/My Music) and the music player will display them in a Tree control. Select an album from the control and the track listing will be displayed in the main window. You can play, pause, and skip to any point in a song. You’ll also be treated to a visualization by Ben Stucki

Downloads

13 Apr 2007. These downloads are the same as the ones in the Apollo Music Player Redux article.

Download Music Player Installer AIR file (you will need to install the Apollo Runtime System first). The uploaded file has an extension of .air but the browser may try to download this file as a .zip. Right click this link and pick Save As and give the file a .air extension. Or download an save the file with a .air extension. This way you can double-click it and the Apollo Runtime will install the application properly.

Download Music Player Source (a zip file with a Flex 2.0.1 Project). The source does not include the visualization component; please download that from Adobe Exchange or remove it from the application.

Music Directory

The music directory ({documents}/My Music, where {documents} is your local documents directory; on Windows that would be My Documents) should be structued like this:

My Music/
        artist/                (eg, Jason Mraz)
             album/          (eg,     Waiting for my Rocket to Come)
                 track         (eg,            You and I Both.mp3)

This is the typical structure created by Windows Media Player when it rips a CD to disk.

Things to Note

I built and tested this application in Flex Builder. Apollo applications are created in a familiar environment with tools you already know.

Existing Flash and Flex content integrate easily. I pulled the visualization component from the Adobe Exchange and used it right away. Any Flex components you have already created can be used as-is.

The Shuffle and Repeat buttons use small Flash 8 SWFs when toggled on. The Repeat button, for example, shows a spinning arrow.

To do

There are still a few things to do:

  • Allow the music directory to be anywhere. Right now I coded it for My Documents/My Music.
  • Display album art in the tree control. Most of the time one or more image files are deposited with the album contents so it could be displayed in the tree.
  • Since HTML content can be easily displayed in an Apollo application, an "Album Details" button could display information about the artist or even display the artist’s web site within the Apollo windows.