Question

I would like to ask how to display the displayed time of the video which show only in system using AS 3.0. Example: it show the seek time and total time using trace(). It there any information or solution to solve it? I appreciate it any of you able to answer it. ^^ Thank you.

Was it helpful?

Solution

I assume that you are using a NetStream object to stream your video?

If so, the NetStream class has a variable called time which gives you the seek time in seconds.

var ns:NetStream;
// load video, etc
...
// update every frame
stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(e:Event):void {
    trace("seek time: " + ns.time);
}

As for the total time, you can get that from the video's metadata by listening to the onMetaData event. See here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top