New issue
Advanced search Search tips

Issue 766002 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Setting .timestampOffset of MediaSource.SourceBuffer within updateend event handler throws error

Reported by guest271...@gmail.com, Sep 17 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/60.0.3112.113 Chrome/60.0.3112.113 Safari/537.36

Steps to reproduce the problem:
1. Set .timestampOffset of multiple tracks within updateend event
2. 
3. 

What is the expected behavior?
timestampOffset to be set

What went wrong?
Uncaught (in promise) DOMException: Failed to set the 'timestampOffset' property on 'SourceBuffer': The timestamp offset may not be set while the SourceBuffer's append state is 'PARSING_MEDIA_SEGMENT'.
    at SourceBuffer.sourceBuffer.onupdateend

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 60.0.3112.113  Channel: n/a
OS Version: 
Flash Version: 

Related https://bugzilla.mozilla.org/show_bug.cgi?id=1400587
 
Workaround using try..catch

                  try {
                    sourceBuffer.timestampOffset += sourceBuffer.buffered.end(0);
                    resolveUpdatedMediaSource();
                  } catch (err) {
                    console.error(err);
                    resolveUpdatedMediaSource();
                  }

https://github.com/guest271314/recordMediaFragments/commit/da902dc083de8229f335cb057bea90407c5f30a7

Comment 2 by ajha@chromium.org, Sep 18 2017

Components: -Blink>Internals Internals>Media>Source
Labels: Needs-Milestone
Owner: wolenetz@chromium.org
Status: Assigned (was: Unconfirmed)
Assigning to wolenetz@ from Issue 737757 for more inputs and further triaging of this.


Status: WontFix (was: Assigned)
This is very likely per spec. Without a specific repro to investigate, I cannot tell more certainly.

MSE spec text (within https://www.w3.org/TR/media-source/#dom-sourcebuffer-timestampoffset):
"If the append state equals PARSING_MEDIA_SEGMENT, then throw an InvalidStateError and abort these steps."

Specifically, even though the user agent has signalled 'updateend', it doesn't mean that the JS app ended that previous appendBuffer with bytes corresponding to the completion of the media segment.

What kind of bytestream are you using?
Is the app unable to determine the media segment boundary for that bytestream and adjust how it appends media and when it signals timestampOffset accordingly?
Note, if you need (though this may drop partially parsed but not yet fully buffered media in not-necessarily-interoperable ways across MSE implementations) to reset the parser state, there is the SourceBuffer.abort() operation which may assist your use case. Note that a future appendBuffer() following such an abort() on the SourceBuffer will require you begin at a segment (init or media) boundary for the bytestream.

Closing this as WAI. Please re-open if this diagnosis is incorrect (along with specific repro steps please).


Sign in to add a comment