This is the official unveiling of the beta version of the Figment Media Player. The Figment Media Player is an open source Adobe Flash (AS3) based music player for your browser. Please note that as this is the first beta release, not all the features of the player are functional yet. However, the most necessary functions (play and pause) work perfectly.
For this demonstration of the player, I've received permission to publish the song Back in Ten by a performer who goes by the name of Fifteen Steps and Counting. Sam Hillifer, the main spectacle of this musical spender, hails from Waterloo ON. He is an up and coming artist, with a whole lot of talent. Check out either his Facebook or Myspace for more info.
In the future, I hope to add multiple track functionality, the ability to skip forward and backward between the tracks, a volume slider, and the ability to select your position within the track. This project is being deemed open source, so have a look at our Creative Commons license (some rights reserved) and get to coding! Here is the code so far, there are some movie clips and whatnot that you will require. I'm sure you can pick them out of the code, if not, download the fla.
import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.net.URLRequest;
var soundClip:Sound = new Sound(); //declaring variable 'clip'
var soundReq:URLRequest = new URLRequest("test1.mp3");//declaring var 'req' value is 'test1.mp3'
var soundContext:SoundLoaderContext = new SoundLoaderContext(8000, true);//declaring variable 'ctx' value is 8 seconds
var soundControl:SoundChannel = new SoundChannel();//controls the sound (stop/go)
var soundPosition:int = new int (soundControl.position);
var soundLength:int = new int (soundClimp.length);
soundClip.load(soundReq, soundContext);//load 'req' with the value of 'ctx' (play at 8 seconds)
soundClip.addEventListener(Event.ACTIVATE, onComplete);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onComplete(event:Event):void{
mc_control.btn_play.addEventListener(MouseEvent.CLICK, playSound);
mc_control.btn_stop.addEventListener(MouseEvent.CLICK, stopSound);
}
function playSound(event:MouseEvent):void{
soundControl.stop();
soundControl = soundClip.play(soundPosition);
mc_control.swapChildren(mc_control.btn_play, mc_control.btn_stop);
}
function stopSound(event:MouseEvent):void{
soundPosition = soundControl.position;
soundControl.stop();
mc_control.swapChildren(mc_control.btn_play, mc_control.btn_stop);
}
function onEnterFrame(event:Event):void{
mc_position.x = 101+(soundControl.position/(Math.ceil(soundClip.length / (soundClip.bytesLoaded / soundClip.bytesTotal)))*294);//% of song played along a bar 294px long
mc_loaded.width = 297*(soundClip.bytesLoaded/soundClip.bytesTotal);//% of song loaded along a bar 297px long
}
I hope you like how far its come, and if you're a developer I hope you email me to find out how you can help. Have a look at the contact page for info on how to get a hold of me.
OXRBeBJLS
Ab fab my golody man.
ukGmIiqKXFzCQwci
aoJCFW jmcjmwrxqfyd
rhGlwzaGdKziejdZFb
z5UP2C vznatudwqkom
Post new Comment