Skip to content

Commit

Permalink
Fix SourceBuffer.remove() calls for IE11
Browse files Browse the repository at this point in the history
On IE11, SourceBuffer.remove(start, Number.POSITIVE_INFINITY) triggers
an 'updateend' event, but does not seem to remove anything.  The same
is true if we swap Number.MAX_VALUE for Number.POSITIVE_INFINITY.
MediaSource.duration does seem to work, though, to remove all content
from buffer.

Fixes #251

Change-Id: I67152f8deceb8926ae1376fdccf73db0c62d0a3e
  • Loading branch information
joeyparrish committed Jan 12, 2016
1 parent 8dffbfe commit 8445b9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/media/source_buffer_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ shaka.media.SourceBufferManager.prototype.clear_ = function() {

try {
// This will trigger an 'updateend' event.
this.sourceBuffer_.remove(0, Number.POSITIVE_INFINITY);
this.sourceBuffer_.remove(0, this.mediaSource_.duration);
} catch (exception) {
return Promise.reject(exception);
}
Expand Down Expand Up @@ -608,7 +608,7 @@ shaka.media.SourceBufferManager.prototype.clearAfter_ = function(timestamp) {
// This will trigger an 'updateend' event.
this.sourceBuffer_.remove(
this.inserted_[index + 1].startTime,
Number.POSITIVE_INFINITY);
this.mediaSource_.duration);
} catch (exception) {
return Promise.reject(exception);
}
Expand Down

0 comments on commit 8445b9d

Please sign in to comment.