W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > August 2011

[Bug 13871] <video> behavior when setting currentTime to current playback position

From: <bugzilla@jessica.w3.org>
Date: Thu, 25 Aug 2011 14:16:57 +0000
To: public-html-bugzilla@w3.org
Message-Id: <E1Qwajp-0005pl-2o@jessica.w3.org>

--- Comment #7 from Philip Jägenstedt <philipj@opera.com> 2011-08-25 14:16:55 UTC ---
(In reply to comment #6)
> (In reply to comment #5)
> > 2. It's more reliable for page authors, as UI won't break when one happens to
> > click the seek bar exactly at currentTime.
> Could you describe how an early exit from the seeking algorithm, i.e., without
> generating a seeking event, will "break" the page's UI?
> I would expect it to act as a NO-OP, simply resulting in no update/change to a
> seek bar.

Something like this:

var v = document.querySelector('video');
var c = document.querySelector('.controls');
var s = document.querySelector('.spinner');
c.onclick = function() {
  var newTime = /* calculate new pos based on click position and duration */;
  v.currentTime = newTime;
  /* if readyState was HAVE_NOTHING an exception was thrown and the next line
is not reached */
  s.display = 'block'; /* show seeking spinner on top of video/controls */
v.seeked = function() {
  s.display = 'none';

If the seeked event is not fired, the spinner won't be hidden possibly
obscuring the video or the controls, in the worst case making it impossible to
issue another seek which would get rid of it.

> Since various other states on the resource may result in a seek exception, a
> realistic UI would not depend on every setting of currentTime to produce a
> seeking event in the first place.

In the example, the spinner is not shown if an exception is thrown when setting

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Thursday, 25 August 2011 14:16:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:02:01 UTC