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

[whatwg] media elements: Relative seeking

From: Maik Merten <maikmerten@googlemail.com>
Date: Mon, 01 Dec 2008 14:06:36 +0100
Message-ID: <4933E15C.9000303@googlemail.com>
Ian Hickson schrieb:
> You can jump to a position that's a fraction of the whole clip by setting 
> 'currentTime' to a fractional multiple of 'duration'.

Right, I was thinking of what happens if no duration could be determined 
with acceptable effort. However, by now I happen to think that 
determining the duration where possible (even if its not completely 
straightforward) is useful enough to require it.


>>  - make currentTime readonly, still have it report playback position in 
>> absolute time. This information should be available in all media formats 
>> due to timestamps in the stream.
>>
>>  - introduce a seek() method, taking a relative value ranging from zero 
>> to one. This allows both accurate seeking if the duration is known and 
>> less precise seeking otherwise if only the length of the file is known 
>> in storage units. This is still way better than not being able to seek 
>> at all.
> 
> Why should currentTime be readonly?

Because seek() would already to trigger seeking (is there a different 
usecase for a writeable currentTime?). Anyway, I don't suggest paying 
attention to my proposals anymore - after some consideration and 
experimentation I don't think they improve anything ;-)

> On Tue, 25 Nov 2008, Maik Merten wrote:
>> This applet does not seek to the end of the stream to retrieve a 
>> timestamp there.
> 
> It should. :-)

And it now does :-)

http://svn.wikimedia.org/viewvc/mediawiki/trunk/cortado/src/com/fluendo/player/DurationScanner.java?view=log

Byte-position based estimates etc. etc. just didn't work out, so I 
finally gave in ( ;-) ) and wrote the ~200 lines of code to actually Do 
Things Approximately Properly(tm).

Seems I saw an implementation problem where none exists.


> 
> On Wed, 26 Nov 2008, Chris Double wrote:
>> I won't be estimating the duration - the user experience of a 
>> fluctuating duration is terrible. For now for Ogg files, I'm seeking to 
>> the end and getting the duration. I may check for X-Content-Duration 
>> which I believe mod_annodex and soon oggz-chop support.
> 
> Cool.

I now finally arrived at the same conclusions.


Maik
Received on Monday, 1 December 2008 05:06:36 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:46 UTC