ed2d65b8 by Jon-Carlos Rivera

Merge pull request #615 from videojs/fix-flash-bandwidth

Fix the IE11 bug without introducing a massive bandwidth leak into Flash playback
2 parents 8da274bf 29d69fa7
...@@ -323,8 +323,8 @@ const filterBufferedRanges = function(predicate) { ...@@ -323,8 +323,8 @@ const filterBufferedRanges = function(predicate) {
323 // report a fully empty buffer until SourceBuffers have been created 323 // report a fully empty buffer until SourceBuffers have been created
324 // which is after a segment has been loaded and transmuxed. 324 // which is after a segment has been loaded and transmuxed.
325 if (!this.mediaSource || 325 if (!this.mediaSource ||
326 !this.mediaSource.mediaSource_ || 326 (this.mediaSource.mediaSource_ &&
327 !this.mediaSource.mediaSource_.sourceBuffers.length) { 327 !this.mediaSource.mediaSource_.sourceBuffers.length)) {
328 return videojs.createTimeRanges([]); 328 return videojs.createTimeRanges([]);
329 } 329 }
330 330
......
...@@ -752,7 +752,7 @@ QUnit.test('starts downloading a segment on loadedmetadata', function() { ...@@ -752,7 +752,7 @@ QUnit.test('starts downloading a segment on loadedmetadata', function() {
752 'the first segment is requested'); 752 'the first segment is requested');
753 }); 753 });
754 754
755 QUnit.test('always returns an empty buffered region when there are no SourceBuffers', function() { 755 QUnit.test('return an empty buffered region when there are no SourceBuffers but a real MediaSource exists', function() {
756 this.player.src({ 756 this.player.src({
757 src: 'manifest/media.m3u8', 757 src: 'manifest/media.m3u8',
758 type: 'application/vnd.apple.mpegurl' 758 type: 'application/vnd.apple.mpegurl'
...@@ -778,11 +778,11 @@ QUnit.test('always returns an empty buffered region when there are no SourceBuff ...@@ -778,11 +778,11 @@ QUnit.test('always returns an empty buffered region when there are no SourceBuff
778 0, 778 0,
779 'empty TimeRanges returned'); 779 'empty TimeRanges returned');
780 780
781 // Simulate the condition with no media source 781 // Simulate the condition with no media source (ie. Flash)
782 delete this.player.hls.mediaSource.mediaSource_; 782 delete this.player.hls.mediaSource.mediaSource_;
783 783
784 QUnit.equal(this.player.tech_.hls.findBufferedRange_().length, 784 QUnit.equal(this.player.tech_.hls.findBufferedRange_().end(0),
785 0, 785 10,
786 'empty TimeRanges returned'); 786 'empty TimeRanges returned');
787 }); 787 });
788 788
......