b986833f by Gary Katsevman

When creating new playlist loader, dispose previous one, if exists

1 parent c8629df3
...@@ -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() {
......