I've been wondering the same thing.
I've done several different variations too.

I first tried to Floor the NetStream.time and duration, but if the
duration is 5.3 seconds and the playhead stopped at 4.99 you end up
with a 5 on 6 comparison.

I then tried to obtain the percentage which did work 100% of the time.

Now I'm using:
var lastPlayheadPosition = NetStream.time;
Math.round(Math.ceil(lastPlayheadPosition)/metadata.duration*100) >= 100;

But I'm worried about clipping or premature stopping.

The only other way I've thought was to evaluate the NetStream.time
against it's previous value and if it doesn't have any change in 4
evals then assume end, but I also have to take in account of
buffering.

I can't help but think there is some algorithm that would produce a
valid end point.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to