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, 2 Feb 2010 07:27:16 -0800
Cc: Simon Pieters <simonp@opera.com>
Message-Id: <0E122668-5C76-449B-8092-A7A444886E22@apple.com>
To: HTMLwg <public-html@w3.org>

On Feb 2, 2010, at 5:14 AM, Simon Pieters wrote:

> http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#seeking
> 
> "4. If the (possibly now changed) new playback position is not in one of the ranges given in the seekable attribute, then the user agent must raise an INDEX_SIZE_ERR exception (if the seek was in response to a DOM method call or setting of an IDL attribute), and abort these steps."
> 
> 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.
> 

  I agree, throwing for an out-of-range seek is unexpected if the questions we have gotten from developers is any indication. I think it makes more sense to clamp the time value to the maximum seekable time.

eric
Received on Tuesday, 2 February 2010 15:27:49 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:13 UTC