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

Re: media element seek algorithm: don't throw

From: Robert O'Callahan <robert@ocallahan.org>
Date: Wed, 3 Feb 2010 08:01:23 +1300
Message-ID: <11e306601002021101v4cae7e54k71309e6ec3a1ff2f@mail.gmail.com>
To: Simon Pieters <simonp@opera.com>
Cc: "public-html@w3.org" <public-html@w3.org>
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.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
Received on Tuesday, 2 February 2010 19:02:07 GMT

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