media element buffered range returning empty if readyState is HAVE_NOTHING

RESOLVED FIXED in Firefox 49

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: jya, Unassigned)

Tracking

(Blocks: 1 bug)

unspecified
mozilla49
Points:
---

Firefox Tracking Flags

(firefox49 fixed)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
This can be seen in:
http://people.mozilla.org/~jyavenard/tests/mse_webm/youtube-durationlastframe.html

We have the following even listener on the source buffer:
    sourceBuffer.addEventListener('update', function(e){
      logger.log('* sourceBuffer.updateend');
      logger.log('sourceBuffer.buffered =' + printTimeRange(sourceBuffer.buffered));
      logger.log('video.duration=' + video.duration);
      logger.log('mediasource.duration = ' + mediaSource.duration);
      logger.log('video.buffered =' + printTimeRange(video.buffered));
    });

Yet, when it runs we see:
369: * sourceBuffer.updateend
370: sourceBuffer.buffered ={{ 0,5.072 }}
370: video.duration=70.07
370: mediasource.duration = 70.07
371: video.buffered ={}

the video.buffered attribute is empty, even though the sourcebuffer buffered attribute isn't.

per spec:
https://w3c.github.io/media-source/index.html#htmlmediaelement-extensions

the media element buffered attribute, should be directly related to the source buffer attribute.
(Reporter)

Comment 1

3 years ago
https://dxr.mozilla.org/mozilla-central/source/dom/html/HTMLMediaElement.cpp#4739

If the readyState is HAVE_NOTHING then the buffered range will always be empty.

I see nothing in regards to this in the spec.
Summary: [MSE] media element buffered range returning empty even after updateend fired. → media element buffered range returning empty if readyState is HAVE_NOTHING
(Reporter)

Comment 2

3 years ago
Chrome will report the buffered range as what's actually buffered even if the readyState is 0.
(Reporter)

Comment 3

3 years ago
Created attachment 8759447 [details]
Bug 1277729: Ignore readyState value when reporting the buffered range.

For plain media playback, the buffered range will always be empty if readyState is HAVE_NOTHING has we need to decode the metadata to determine the duration and eventually decode the first frame to determine the start time. With MSE however, the buffered range is per spec directly related to the source buffer buffered range.

So we can always simply query the MediaDecoder to determine the buffered range regardless of the readyState value.

Review commit: https://reviewboard.mozilla.org/r/57432/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/57432/
Attachment #8759447 - Flags: review?(jwwang)
Comment on attachment 8759447 [details]
Bug 1277729: Ignore readyState value when reporting the buffered range.

https://reviewboard.mozilla.org/r/57432/#review54228
Attachment #8759447 - Flags: review?(jwwang) → review+

Comment 5

3 years ago
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f75d7afd686e
Ignore readyState value when reporting the buffered range. r=jwwang

Comment 6

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f75d7afd686e
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox49: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.