diff --git a/src/js/player.js b/src/js/player.js index 2073537867..f5f1ac44de 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -3371,7 +3371,7 @@ class Player extends Component { }); // Try another available source if this one fails before playback. - if (this.options_.retryOnError && sources.length > 1) { + if (sources.length > 1) { const retry = () => { // Remove the error modal this.error(null); diff --git a/test/unit/player.test.js b/test/unit/player.test.js index dcade79bdc..3348834235 100644 --- a/test/unit/player.test.js +++ b/test/unit/player.test.js @@ -384,10 +384,9 @@ QUnit.test('should asynchronously fire error events during source selection', fu log.error.restore(); }); -QUnit.test('should retry setting source if error occurs and retryOnError: true', function(assert) { +QUnit.test('should retry setting source if error occurs', function(assert) { const player = TestHelpers.makePlayer({ techOrder: ['html5'], - retryOnError: true, sources: [ { src: 'http://vjs.zencdn.net/v/oceans.mp4', type: 'video/mp4' }, { src: 'http://vjs.zencdn.net/v/oceans2.mp4', type: 'video/mp4' }, @@ -439,10 +438,9 @@ QUnit.test('should retry setting source if error occurs and retryOnError: true', player.dispose(); }); -QUnit.test('should not retry setting source if retryOnError: true and error occurs during playback', function(assert) { +QUnit.test('should not retry setting source if error occurs during playback', function(assert) { const player = TestHelpers.makePlayer({ techOrder: ['html5'], - retryOnError: true, sources: [ { src: 'http://vjs.zencdn.net/v/oceans.mp4', type: 'video/mp4' }, { src: 'http://vjs.zencdn.net/v/oceans2.mp4', type: 'video/mp4' }, @@ -490,7 +488,6 @@ QUnit.test('should not retry setting source if retryOnError: true and error occu QUnit.test('aborts and resets retryOnError behavior if new src() call made during a retry', function(assert) { const player = TestHelpers.makePlayer({ techOrder: ['html5'], - retryOnError: true, sources: [ { src: 'http://vjs.zencdn.net/v/oceans.mp4', type: 'video/mp4' }, { src: 'http://vjs.zencdn.net/v/oceans2.mp4', type: 'video/mp4' }, diff --git a/test/unit/sourceset.test.js b/test/unit/sourceset.test.js index 4c1e0f952b..3d9e515d51 100644 --- a/test/unit/sourceset.test.js +++ b/test/unit/sourceset.test.js @@ -17,9 +17,11 @@ const testSrc = { src: 'http://example.com/testSrc.mp4', type: 'video/mp4' }; -const sourceOne = {src: 'http://example.com/one.mp4', type: 'video/mp4'}; -const sourceTwo = {src: 'http://example.com/two.mp4', type: 'video/mp4'}; -const sourceThree = {src: 'http://example.com/three.mp4', type: 'video/mp4'}; +// Using a real URL here makes the tests work with retryOnError by default +// however, this means that it may fail offline +const sourceOne = {src: 'https://vjs.zencdn.net/v/oceans.mp4?one', type: 'video/mp4'}; +const sourceTwo = {src: 'https://vjs.zencdn.net/v/oceans.mp4?two', type: 'video/mp4'}; +const sourceThree = {src: 'https://vjs.zencdn.net/v/oceans.mp4?three', type: 'video/mp4'}; if (!Html5.canOverrideAttributes()) { qunitFn = 'skip';