Skip to content

Commit

Permalink
Avoid uncaught exception on SourceBuffer.abort() in buffer already re…
Browse files Browse the repository at this point in the history
…moved from the parent MediaSource (Dash-Industry-Forum#3799)
  • Loading branch information
bbert authored and vodlogic committed Dec 16, 2021
1 parent 3c07961 commit c250aa2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/streaming/SourceBufferSink.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,14 @@ function SourceBufferSink(config) {
appendQueue = [];
if (mediaSource.readyState === 'open') {
_waitForUpdateEnd(() => {
if (buffer) {
buffer.abort();
try {
if (buffer) {
buffer.abort();
}
resolve();
} catch (e) {
resolve();
}
resolve();
});
} else if (buffer && buffer.setTextTrack && mediaSource.readyState === 'ended') {
buffer.abort(); //The cues need to be removed from the TextSourceBuffer via a call to abort()
Expand All @@ -418,7 +422,6 @@ function SourceBufferSink(config) {
resolve();
}
});

}

function _executeCallback() {
Expand Down

0 comments on commit c250aa2

Please sign in to comment.