When creating new playlist loader, dispose previous one, if exists
Showing
1 changed file
with
5 additions
and
0 deletions
... | @@ -101,6 +101,11 @@ videojs.Hls.prototype.handleSourceOpen = function() { | ... | @@ -101,6 +101,11 @@ videojs.Hls.prototype.handleSourceOpen = function() { |
101 | sourceBuffer.appendBuffer(this.segmentParser_.getFlvHeader()); | 101 | sourceBuffer.appendBuffer(this.segmentParser_.getFlvHeader()); |
102 | 102 | ||
103 | this.mediaIndex = 0; | 103 | this.mediaIndex = 0; |
104 | |||
105 | if (this.playlists) { | ||
106 | this.playlists.dispose(); | ||
107 | } | ||
108 | |||
104 | this.playlists = new videojs.Hls.PlaylistLoader(this.src_, settings.withCredentials); | 109 | this.playlists = new videojs.Hls.PlaylistLoader(this.src_, settings.withCredentials); |
105 | 110 | ||
106 | this.playlists.on('loadedmetadata', videojs.bind(this, function() { | 111 | this.playlists.on('loadedmetadata', videojs.bind(this, function() { | ... | ... |
-
Please register or sign in to post a comment