Skip to content

Commit

Permalink
stream-controller: reset this.mediaBuffer on MEDIA_ATTACHED
Browse files Browse the repository at this point in the history
fix Failed to read the 'buffered' property from 'SourceBuffer': This SourceBuffer has been removed from the parent media source. exception

related to video-dev#620
  • Loading branch information
mangui committed Aug 17, 2016
1 parent 28f075d commit d5ec796
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/controller/audio-stream-controller.js
Expand Up @@ -282,7 +282,7 @@ class AudioStreamController extends EventHandler {
}

onMediaAttached(data) {
var media = this.media = data.media;
var media = this.media = this.mediaBuffer = data.media;
this.onvseeking = this.onMediaSeeking.bind(this);
this.onvended = this.onMediaEnded.bind(this);
media.addEventListener('seeking', this.onvseeking);
Expand Down
2 changes: 1 addition & 1 deletion src/controller/stream-controller.js
Expand Up @@ -659,7 +659,7 @@ class StreamController extends EventHandler {
}

onMediaAttached(data) {
var media = this.media = data.media;
var media = this.media = this.mediaBuffer = data.media;
this.onvseeking = this.onMediaSeeking.bind(this);
this.onvseeked = this.onMediaSeeked.bind(this);
this.onvended = this.onMediaEnded.bind(this);
Expand Down

0 comments on commit d5ec796

Please sign in to comment.