Guess I’ll fill in some details

Turns out On the Boards is on top of the blogosphere happenings and found my previous post already and linked to it off their blog. So I figure I should actually include a few more details about how the On the Boards media player works.

I had not built a video player in Flash before this project, turns out it’s pretty simple. The basic Flash components work well and make it simple to stream video. The media player was built to handle both audio and video playback in a single player. It just made for a better user experience. Although I suppose we could have had all the audio files encoded as the soundtrack in video files, but our solution also makes it easier for On the Boards. Since Flash doesn’t support audio only playback through the FLVPlayback component, we used the FLVPlayback component for video and the standard Sound object for audio playback. The interesting bit there was coordinating the two so they didn’t overlap when switching media and making all the controls work for either audio or video. We ended up making all the controls not know about either playback controller. They raise events which are captured by our main class which knows what the active playback component is so it can then relay the button command. This chain of events also works the other way around, for example when the player needs to buffer data before continuing playback. It also makes it simple if we ever needed to add more playback controllers, not that I can think of any at this point in time, but you never know.

Leave a Reply