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 17071 - Define how presentation duration is set & updated
Summary: Define how presentation duration is set & updated
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Media Source Extensions (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Adrian Bateman [MSFT]
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-15 23:34 UTC by Aaron Colwell (c)
Modified: 2012-07-30 20:42 UTC (History)
5 users (show)

See Also:


Attachments

Description Aaron Colwell (c) 2012-05-15 23:34:49 UTC
The current spec text makes no mention of how the duration attribute on the HTMLMediaElement is set. 

The current Chromium implementation just fetches this value from the first initialization segment and uses that. This is ok if all the initialization segments happen to have the same duration. In the ad-insertion use case though an initialization segment with a significantly different duration may get appended and the web application may want the inserted content to actually increase the duration of the presentation.

Rules about how duration is set and updated need to be defined.
Comment 1 Aaron Colwell (c) 2012-05-15 23:35:45 UTC
A possible solution to consider:

Make duration attribute writable and don't allow a transition to HAVE_METADATA until it is set by the web application or the first initialization segment is appended with a duration. From that point on the duration can only be modified by the web application and future initialization segments won't effect the duration. If the duration becomes shorter than the previous value, all data in the source buffer beyond the duration will be flushed. If the playback position is beyond the new duration, the HTMLMediaElement will act as if it just reached the end of the presentation and fire all appropriate events.

If we feel it's necessary to allow the duration to be updatable by a future initialization segment, then we could simply have the web application set the duration to NaN. (I'm not thrilled about this, but interested in comments.)
Comment 2 Aaron Colwell (c) 2012-07-30 20:42:41 UTC
Spec changes committed.

Revision: 
http://dvcs.w3.org/hg/html-media/rev/087ea42f59c8

Mailing list discussion: 
http://lists.w3.org/Archives/Public/public-html-media/2012Jul/0050.html