This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
This is a proposal to add a method to remove time ranges from the SourceBuffer. append() lets the application explicitly add media to the presentation and this would allow it to explicitly remove media. Here is the proposed signature & some initial ideas about how it should behave. partial interface SourceBuffer { void flush(TimeRanges ranges); }; - If readyState is not 'open' throw an INVALID_STATE_ERR exception - ranges.start() is inclusive & ranges.end() is exclusive (ie [0-1) ). Any media data with a starting timestamp within this range will be removed. - If ranges.end() is in the middle of a group of pictures(GOP), everything between end() and the end of the GOP will be removed. - If the beginning of a GOP is inside a range, then the whole GOP will be removed.
TimeRange objects can't be created from script (TimeRanges is not a constructor) so it would have to be something like flush(start, end), unless the only use case is to remove everything covered by another SourceBuffer. Also, I think remove(...) would be more clear, flush(...) sounds a lot like it has something to do with the playback pipeline, at least this is what I associate it with: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-events-definitions.html#section-events-flush-start
Good points. How about this? partial interface SourceBuffer { void reset(double start, double end); }; - If readyState is not 'open' throw an INVALID_STATE_ERR exception - start is inclusive & end is exclusive (ie [0-1) ). Any media data with a starting timestamp within this range will be removed. - If end is in the middle of a group of pictures(GOP), everything between end and the end of the GOP will be removed. - If the beginning of a GOP is inside a range, then the whole GOP will be removed.
(In reply to comment #2) > Good points. How about this? > > partial interface SourceBuffer { > void reset(double start, double end); > }; > > - If readyState is not 'open' throw an INVALID_STATE_ERR exception > - start is inclusive & end is exclusive (ie [0-1) ). Any > media data with a starting timestamp within this range will be removed. > - If end is in the middle of a group of pictures(GOP), everything > between end and the end of the GOP will be removed. > - If the beginning of a GOP is inside a range, then the whole GOP will be > removed. Make that remove() not reset()
That sounds OK to me.
Changes committed. Initial remove() IDL and algorithm added http://dvcs.w3.org/hg/html-media/rev/4d013fe2dbec Updated algorithm to describe what happens if the current playback position is removed. http://dvcs.w3.org/hg/html-media/rev/0c638da9a67a