asscripter
01-14-2008, 11:59 AM
Hi i'm making a simple flv player where i'm creating the seekbar to show the video playback progress.
While i drag the dragger (small rectangle to show video progress) the video frames do not update fast enough with the dragger.
mc_VideoSeekbar.mc_Drager.onPress = function() {
this.startDrag(false, 0, 0, 250, 0);
this.onEnterFrame = function() {
var base = this._parent.mc_Track._width-this._width;
var perc:Number = Math.round(this._x*100/base);
this._parent._parent.mc_FLVPlayback.seek(perc/100*iTotalDuration);
};
};
mc_VideoSeekbar.mc_Drager.onRelease = mc_VideoSeekbar.mc_Drager.onReleaseOutside=functio n () {
this.stopDrag();
delete this.onEnterFrame;
};
mc_FLVPlayback is the flash's FLVPlayback component.
Pls suggest how can i optimise the code to show realtime video seeking?
While i drag the dragger (small rectangle to show video progress) the video frames do not update fast enough with the dragger.
mc_VideoSeekbar.mc_Drager.onPress = function() {
this.startDrag(false, 0, 0, 250, 0);
this.onEnterFrame = function() {
var base = this._parent.mc_Track._width-this._width;
var perc:Number = Math.round(this._x*100/base);
this._parent._parent.mc_FLVPlayback.seek(perc/100*iTotalDuration);
};
};
mc_VideoSeekbar.mc_Drager.onRelease = mc_VideoSeekbar.mc_Drager.onReleaseOutside=functio n () {
this.stopDrag();
delete this.onEnterFrame;
};
mc_FLVPlayback is the flash's FLVPlayback component.
Pls suggest how can i optimise the code to show realtime video seeking?