Bug 18708 - Allow SourceBuffer.append() in "ended" readyState.
Summary: Allow SourceBuffer.append() in "ended" readyState.
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Media Source Extensions (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Adrian Bateman [MSFT]
QA Contact: HTML WG Bugzilla archive list
Depends on:
Reported: 2012-08-27 17:42 UTC by Aaron Colwell (c)
Modified: 2012-10-01 22:32 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Colwell (c) 2012-08-27 17:42:55 UTC
Currently SourceBuffer.append() doesn't allow calls in the "ended" readyState. It was brought to my attention that it may be useful to allow appending after endOfStream() is called because the application may want to increase the quality of a region in the presentation.

If people think this would be useful, I propose that calling append() while in the "ended" readyState will:

1. Cause MediaSource.readyState to transition to "open" and fire a "sourceopen" on the media source object.
2. Allow the append() to act like it would if it had been called in the "open" state.
Comment 1 Philip Jägenstedt 2012-08-28 08:14:30 UTC
Couldn't the application simply not call endOfStream() in this situation?
Comment 2 Aaron Colwell (c) 2012-09-14 19:57:42 UTC
(In reply to comment #1)
> Couldn't the application simply not call endOfStream() in this situation?

If you don't call endOfStream(), then you are not guaranteed playback will reach duration if the streams happen to be different lengths. Without end of stream the user agent can't diffentiate missing data at the end of one of the tracks from tracks that have slightly different durations. 

Admittedly this is an edge case but it is one of the main reasons why the endOfStream() call exists. If we don't allow this, then the application would have to monitor when the playback position is approaching duration and then call endOfStream() right before the end so that all the normal end of playback algorithms will run. 

Allowing appends to trigger a transition from "ended" back to "open" seemed like a simply way to allow the application to change its mind about being done.
Comment 3 Philip Jägenstedt 2012-09-17 08:11:08 UTC
Yeah, I suppose this makes sense if the user has watched the end of the video but then seeks to a part which isn't buffered at all or buffered at a lower bitrate than can currently be achieved.
Comment 4 Aaron Colwell (c) 2012-10-01 22:29:06 UTC
Changes committed.