W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2008

[whatwg] media elements: Relative seeking

From: Maik Merten <maikmerten@googlemail.com>
Date: Tue, 25 Nov 2008 14:35:26 +0100
Message-ID: <492BFF1E.1050607@googlemail.com>
Silvia Pfeiffer schrieb:
> Are you using the byte position to estimate duration or are you using
> the granulepos in Ogg to do this? The granulepos on the last data page
> may be more accurate than simply using byte positions in Ogg. However,
> it may also be more complicated and error-prone.

This applet does not seek to the end of the stream to retrieve a 
timestamp there. Instead, it's simply computing the duration as

duration = currentTime * (totalByteCount / currrentBytePosition)

currentTime is taken from the stream timestamps, totalByteCount from the 
HTTP contentlength and currentBytePosition is the current offset into 
the media resource as used to retrieve the next chunk from the HTTP server.

The latter is only an approximation of the current playback 
byte-position due to buffering and I still need to substract the bytes 
in the buffer, so the current state is vastly suboptimal.


> In any case - if you (and also Chris Double) are satisfied with the
> estimates you're getting for file duration/length - I'll stop arguing
> for it. It would be nice to hear some experimental evidence about how
> well it's doing, e.g. for typical movie trailers, so we can lay that
> argument to bed knowing we've done our homework.

I'll continue to experiment.


Maik
Received on Tuesday, 25 November 2008 05:35:26 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:07 UTC