VidepPlayer Creating Using Flash AS3

1.Create new fla file in flash using as3.0
2.Create the following buttons and give the instance name as per list

Play btn->play_btn
Stop button ->stop_btn
Pause button ->pause_btn

3.Create the volume bar for the custom video player (in inner movieclop the the volume slider bar instance name as slider) & over all volume bar to give the instance name as  vbar_mc

4. Using the import the FLVPlayback,we can import the player in runtime & load the movie using the following codes.

5.In slider bar we use the startDrag,stopDrag option for get the volume value.using the Rectangel values (first value is x, y valuse,width,height) in Darg option to set the volume values.

=================

import fl.video.FLVPlayback;

var flvplay = new FLVPlayback();
flvplay.source = “1254014.flv”;
addChild(flvplay);

flvplay.x =60;
flvplay.y= 0;
flvplay.width = 330;
flvplay.height = 330;

flvplay.volume =0;
//flvseekbar = SeekBar;
flvplay.seekBar =flvseekbar;
flvplay.bufferingBar = flbbuff;

play_btn.addEventListener(MouseEvent.CLICK,playhandler);
pause_btn.addEventListener(MouseEvent.CLICK,pausehandler);
stop_btn.addEventListener(MouseEvent.CLICK,stophandler);

function playhandler(e:MouseEvent):void
{
flvplay.play();
}

function pausehandler(e:MouseEvent):void
{
flvplay.pause();
}

function stophandler(e:MouseEvent):void
{
flvplay.stop();
flvplay.seek(0);
}

this.vbar_mc.slider.addEventListener(MouseEvent.MOUSE_DOWN,vdown);

function vdown(e:MouseEvent):void
{
vbar_mc.slider.startDrag(false,new Rectangle(0,12,50,0));

addEventListener(Event.ENTER_FRAME,vohandler);
stage.addEventListener(MouseEvent.MOUSE_UP,vrelease);

}
function vrelease(e:MouseEvent):void
{
this.vbar_mc.slider.stopDrag();
removeEventListener(Event.ENTER_FRAME,vohandler);

}

function vohandler(e:Event):void
{
flvplay.volume = vbar_mc.slider.x*2/100;
}

Advertisements

Posted on December 2, 2009, in Flash and tagged . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: