This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 18208 - <track> missed cues will include all past cues from a newly enabled track
Summary: <track> missed cues will include all past cues from a newly enabled track
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Silvia Pfeiffer
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 17:41 UTC by contributor
Modified: 2012-09-28 05:45 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2012-07-18 17:41:09 UTC
This was was cloned from bug 17235 as part of operation convergence.
Originally filed: 2012-05-29 15:35:00 +0000

================================================================================
 #0   contributor@whatwg.org                          2012-05-29 15:35:57 +0000 
--------------------------------------------------------------------------------
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html
Multipage: http://www.whatwg.org/C#media-playback
Complete: http://www.whatwg.org/c#media-playback

Comment:
<track> missed cues will include all past cues from a newly enabled track

Posted from: 2001:4c28:a032:32:9589:8db1:7691:37b7 by philipj@opera.com
User agent: Opera/9.80 (X11; Linux x86_64; U; Edition Next; en) Presto/2.10.289 Version/12.00
================================================================================
 #1   Philip J                                        2012-05-29 15:42:56 +0000 
--------------------------------------------------------------------------------
<quote>
1. Let current cues be a list of cues, initialized to contain all the cues of all the hidden, showing, or showing by default text tracks of the media element (not the disabled ones) whose start times are less than or equal to the current playback position and whose end times are greater than the current playback position.

2. Let other cues be a list of cues, initialized to contain all the cues of hidden, showing, and showing by default text tracks of the media element that are not present in current cues.

4. If the current playback position has, since the last time this algorithm was run, only changed through its usual monotonic increase during normal playback, then let missed cues be the list of cues in other cues whose start times are greater than or equal to last time and whose end times are less than or equal to the current playback position. Otherwise, let missed cues be an empty list.
</quote>

By this definition, switching tracks while playback is ongoing will cause all cues in the new track that have already ended to be treated as missed, which will cause enter/exit events to be fired. This seems fairly broken and is not what we want to implement.

A quickfix that matches our intentions is to rewrite step 2 to only add cues from tracks that were in the track list the last time the algorithm was run to "other cues".
================================================================================
 #2   Philip J                                        2012-05-29 15:49:14 +0000 
--------------------------------------------------------------------------------
It looks like the spec might also treat cues recently added by scripts as missed, which is similarly broken. We "synchronize" a track every time a new cue is added by script to avoid treating such cues as missed, but are not quite sure how to express that in the spec...
================================================================================
 #3   Philip J                                        2012-06-01 16:09:40 +0000 
--------------------------------------------------------------------------------
We've now fixed our implementation to never consider tracks inserted between invocations of the "When the current playback position of a media element changes" algorithm as missed. All cues are initially placed on a pending list, and in the next invocation of the algorithm they can never be considered missed. The pending list is then cleared. We think this is the behavior that makes the most sense, but of course don't mind how it's expressed in the spec.
================================================================================
 #4   Philip J                                        2012-06-01 16:17:10 +0000 
--------------------------------------------------------------------------------
(In reply to comment #3)
> We've now fixed our implementation to never consider tracks inserted between

Typo, I meant cues inserted between invocations. (This is a separate issue from inserted tracks, sorry for mixing both in the same bug.)
================================================================================
Comment 1 Silvia Pfeiffer 2012-09-28 05:45:41 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If
you are satisfied with this response, please change the state of
this bug to CLOSED. If you have additional information and would
like the Editor to reconsider, please reopen this bug. If you would
like to escalate the issue to the full HTML Working Group, please
add the TrackerRequest keyword to this bug, and suggest title and
text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this
document:   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: applied patch
https://github.com/w3c/html/commit/8dbaab7e7e15799872856f3b4a1416fee1090dbd
Rationale: adopted resolution by WHATWG