What's this? It looks easy!
OK. I really don't like building MP3 player components in AS3 for Flex. It's doable, sure, but tedious. In fact, I don't like it enough that I've done something about it. Now it can be fun to make an MP3 player in Flex! (not available yet, but there's a demo below).
-
<my:SimpleMP3
-
id="music"
-
url="http://url.com/my.mp3" />
Now, just treat it like you'd expect!
-
music.play();
-
music.pause();
-
music.stop();
-
music.volume = 0..1;
Yes, there's more: scrubbing, streaming, buffering, panning left to right, auto load, auto play, auto rewind, repeat and most importantly ... states! Read more and play with a quick demo after the jump.
Try it out:
This is not a feature complete demo, but you'll get the idea. More, better demos to come.
(Right click to view source)
So that's not the coolest demo you've ever seen. The point is: it takes almost zero effort to play, scrub, stream, buffer, pause or stop an mp3, adjust the volume, pan the audio, monitor loading and playback progress and best of all: simply hook it into your UI with states and state booleans.
SimpleMP3 will be released under the MIT license. If you're interested in getting your hands on some pre-alpha code and helping out just let me know!
Update:
mysimplemp3 has been released. Read more about it by clicking the <my:SimpleMP3 /> tab at the top of this website.
Scot,
this is totally great man. I am going to find a use for this for sure.
thanks for posting this player on your site. One thing that it seams I have to spend a lot of time doing is creating the guts of this all the time. Even if you are just copy and pasting code it still takes time. What a great way to speed up the process.
-Matthew