W3C home > Mailing lists > Public > public-html@w3.org > February 2010

Re: media element seek algorithm: don't throw

From: Eric Carlson <eric.carlson@apple.com>
Date: Tue, 02 Feb 2010 17:01:37 -0800
Cc: Simon Pieters <simonp@opera.com>, "public-html@w3.org" <public-html@w3.org>
Message-id: <037FEC01-02B2-42BE-9334-B9BAEC66F90C@apple.com>
To: robert@ocallahan.org

On Feb 2, 2010, at 11:01 AM, Robert O'Callahan wrote:

> On Wed, Feb 3, 2010 at 2:14 AM, Simon Pieters <simonp@opera.com> wrote:
> It's annoying to use try/catch every time you set currentTime. It's nicer to check seekable and then set currentTime. However, even if you check seekable there's no guarentee that currentTime won't throw because the cache might be cleared between the check and the setting. Therefore we think it's better to silently abort the algorithm instead of throwing.
> 
> In Gecko, we avoid that kind of problem by being very careful to ensure that asynchronous cache and codec state changes aren't visible to scripts. (We haven't implemented 'seekable' yet, but my plan is, when a script reads 'seekable' we compute the result, store it, and pin the element's cache entries until the script runs to completion, so subsequent reads of 'seekable' return the same result and seeking to times in 'seekable' can't fail.) I think this is critical to make the media API usable in a robust manner. Maybe the spec should say something about that.
> 
  This isn't possible lock the element's cache with all media engines, but even it is was I don't think it would be good to spec that behavior. Loading and buffering may happen on another thread, or in another process, and the loader may have a hard limit on what it can buffer. For example the "live" buffer on my DRV that is limited to the previous 30 minutes, and the wall clock doesn't stop just because a script is running.

eric
Received on Wednesday, 3 February 2010 01:02:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:17:01 GMT