« Yahoo! Toolbar Download Update | Main | iPod Bible Player (Do you remember FlashPad?) »

March 30, 2005

Position of the Playhead

NetStream.time returns the position of the playhead, in seconds. I was under the impression that this could be any value. It turns out, as everything is quantized, the playhead moves from tag to tag in a FLV.

So you can be sure that there's a tag with the timestamp at every NetStream.time value you read. If there's no tag with a particular timestamp, NetStream.time won't return that value.

That explains why NetStream.time will return the timestamp of the last tag at the end of a FLV playback, and not the actual duration of the FLV (FLV files always start at time 0). We have added the lasttimestamp value to the metadata injected by our free FLV MetaData Injector tool fairly recently, but I thought this was something odd that happened only at the end of a FLV...

March 30, 2005 in Flash | Permalink

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/8749/2150038

Listed below are links to weblogs that reference Position of the Playhead:

Comments

Awesome! The time never reaching duration was a big one for me! I guess 'lasttimestamp' is also the greatest value that you can seek to without the netstream hanging in seek mode?

Posted by: Rob Walch at Apr 23, 2005 11:52:22 PM

Hi Rob,

With FLVMDI 2.0 (currently public beta) we have 'lastkeyframetimestamp' value which should be the last time you can seek without hanging (it's the timestamp of the last video key frame in the FLV).

'lasttimestamp' is what it says, the timestamp value of the last tag in the FLV file. NetStream.Time will return this value, rather than the duration, so it's more useful than the 'duration' when detecting the FLV end.

Best regards,
Burak

Posted by: Burak KALAYCI at Apr 24, 2005 12:01:45 AM

Post a comment