Re: [MSE] Define how presentation duration is set & updated

On Jul 12, 2012, at 1:28 PM, Aaron Colwell wrote:

Hi,

I wanted to start a discussion about Bug 17071<https://www.w3.org/Bugs/Public/show_bug.cgi?id=17071> which talks about how to establish the presentation duration. Here is the gist of the proposal.

1. Add a duration attribute to the MediaSource object
partial interface MediaSource {
  attribute unrestricted double duration
};

2. duration is NaN while MediaSource.readyState == "closed"

3. If duration is NaN and an initialization segment with a duration is appended, then duration becomes the value contained in the initialization segment.

4. When MediaSource.readyState == "open", duration can be set anytime  by the web application with a value > 0 or positive Infinity. Using other values will be ignored and trigger an exception.

5. If duration is set to a value less than what is buffered in the MediaSource.sourceBuffers, then all data beyond the duration will be removed from each SourceBuffer.

6. HTMLMediaElement.readyState can't transition to HAVE_METADATA until duration becomes something other than NaN.

I expect people with live content will want to have the duration remain as NaN.


I think all of the above should be pretty uncontroversial, but I have a few questions.

- What should happen if a media segment is appended that starts before the duration and ends past the duration? Should the duration be updated or should the segment be truncated?

I'm not sure it matters much which we choose, but perhaps it is more robust to update it ? Frequently there are minor differences in the durations of different tracks of a piece of content (of the order of a frame or sample duration) and the duration reported in some content-wide metadata may be any one of these or even some duration taken from the source material.


- What should happen if the entire media segment is beyond the duration?

Depends on the answer to the above question. If we're auto-updating the duration in that case I think the duration should be updated in this case too.


- What should happen if a new duration is set and HTMLMediaElement.currentTime is beyond that? Should this act like a seek to duration?

Seems reasonable. How does a media element deal with this in the non-MediaSource case ?


Please let me know what you think and whether I have missed any key scenarios.

Thanks,
Aaron

Received on Thursday, 12 July 2012 21:07:16 UTC