kangur91
April 13th, 2009, 06:47 AM
Hello. I used this tutorial
http://www.thetechlabs.com/video/how-to-build-a-as3-videoplayer/
I've got a question: How to do scrubber(it's showing actually position)
wchich will be starting on position x=70 (default was x=0 but i changed that)?
You can see on screens :
http://img15.imageshack.us/gal.php?g=layer2v.png
Podaje kod:
function updateDisplay(e:TimerEvent):void {
// checks, if user is scrubbing. if so, seek in the video
// if not, just update the position of the scrubber according
// to the current time
if(bolProgressScrub)
nsStream.seek(Math.round(mcVideoControls.mcProgres sScrubber.x * objInfo.duration/ 270))
else mcVideoControls.mcProgressScrubber.x = nsStream.time * 270 / objInfo.duration;
// set time and duration label
mcVideoControls.lblTimeDuration.htmlText = "<font color='#ffffff'>" + formatTime(nsStream.time) + "</font> / " + formatTime(objInfo.duration);
// update the width from the progress bar. the grey one displays
// the loading progress
mcVideoControls.mcProgressFill.mcFillRed.width = mcVideoControls.mcProgressScrubber.x + 5;
mcVideoControls.mcProgressFill.mcFillGrey.width = nsStream.bytesLoaded * 270 / nsStream.bytesTotal;
// update volume and the red fill width when user is scrubbing
if(bolVolumeScrub) {
setVolume((mcVideoControls.mcVolumeScrubber.x - 318) / 53);
mcVideoControls.mcVolumeFill.mcFillRed.width = mcVideoControls.mcVolumeScrubber.x - 371 + 53;
}
// chech if user is currently hovering over description label
}
http://www.thetechlabs.com/video/how-to-build-a-as3-videoplayer/
I've got a question: How to do scrubber(it's showing actually position)
wchich will be starting on position x=70 (default was x=0 but i changed that)?
You can see on screens :
http://img15.imageshack.us/gal.php?g=layer2v.png
Podaje kod:
function updateDisplay(e:TimerEvent):void {
// checks, if user is scrubbing. if so, seek in the video
// if not, just update the position of the scrubber according
// to the current time
if(bolProgressScrub)
nsStream.seek(Math.round(mcVideoControls.mcProgres sScrubber.x * objInfo.duration/ 270))
else mcVideoControls.mcProgressScrubber.x = nsStream.time * 270 / objInfo.duration;
// set time and duration label
mcVideoControls.lblTimeDuration.htmlText = "<font color='#ffffff'>" + formatTime(nsStream.time) + "</font> / " + formatTime(objInfo.duration);
// update the width from the progress bar. the grey one displays
// the loading progress
mcVideoControls.mcProgressFill.mcFillRed.width = mcVideoControls.mcProgressScrubber.x + 5;
mcVideoControls.mcProgressFill.mcFillGrey.width = nsStream.bytesLoaded * 270 / nsStream.bytesTotal;
// update volume and the red fill width when user is scrubbing
if(bolVolumeScrub) {
setVolume((mcVideoControls.mcVolumeScrubber.x - 318) / 53);
mcVideoControls.mcVolumeFill.mcFillRed.width = mcVideoControls.mcVolumeScrubber.x - 371 + 53;
}
// chech if user is currently hovering over description label
}