Saturday, October 2, 2010

Flex Mp3 Player supports buffering ,streaming and visualizer.


Flex ...
this is a simple control "Mp3 Player" supports buffering and has a visualizer.

we will see together how to cook ... make * one home :) .

lets summarize it in some points:
  • how buffering works.
  • playing files.
  • visualizer.
Beffering
simple as you can see below you just need to have :
  • a Sound Object : to be able to play the file.
  • aURLRequest Object : to get the file to play.
  • a SoundLoaderContext Object: to load the file into sound channel.
  • for more info go there.
now you got the file , you loaded it and you are playing the file.

just notice that play function accepts parameters to enable you set the start time in the sound file. but it should be loaded.

so if you know if the start time available to play then buffering mission is completed .

-------------------------------------------------------------------------------------------------
import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.net.URLRequest;

var s:Sound = new Sound();
var req:URLRequest = new URLRequest("bigSound.mp3");
var context:SoundLoaderContext = new SoundLoaderContext(8000, true);
s.load(req, context);
s.play();

-------------------------------------------------------------------------------------------------

Playing files
as we mentioned before just your url request , soundloader and sound.
what you have to do is just changing the url of the urlrequest by the new file.

Visualizer
i didn't make it i just used it .

here is the player you can make yours home , enjoy :) ----> ZIZOOO Mp3Player


4 comments:

Muhammad said...

i couldn't solve the sandbox problem on the hosting server so visualizer may not appear

Ahmed Mubarak said...

sybak enta .. silverlight yksab :D nice post

Muhammad said...

mseri ha join brdo silverlight , isA :)

Ehab Abd El-Nasser said...

WOW ... i like the idea...
KEEP IT UP BUDY!!