diff --git a/docs/tutorials/config.md b/docs/tutorials/config.md index 75b9531e5f..e8c8df546e 100644 --- a/docs/tutorials/config.md +++ b/docs/tutorials/config.md @@ -128,6 +128,7 @@ With `.streaming.lowLatencyMode` set to true, `.streaming.segmentPrefetchLimit` is set to 2 by default, `.streaming.updateIntervalSeconds` is set to 0.1 by default, `.streaming.retryParameters.baseDelay` is set to 100 by default, +`.manifest.dash.autoCorrectDrift` is set to false by default, `.manifest.retryParameters.baseDelay` is set to 100 by default, and `.drm.retryParameters.baseDelay` is set to 100 by default. @@ -147,6 +148,9 @@ player.configure({ }, }, manifest: { + dash: { + autoCorrectDrift: true, + }, retryParameters: { baseDelay: 100, }, diff --git a/externs/shaka/player.js b/externs/shaka/player.js index ec9aba216a..44703e8238 100644 --- a/externs/shaka/player.js +++ b/externs/shaka/player.js @@ -1331,9 +1331,8 @@ shaka.extern.ManifestConfiguration; * extra segment requests necessary to compensate for drift. * @property {boolean} lowLatencyMode * If true, low latency streaming mode is enabled. If - * lowLatencyMode is set to true, inaccurateManifestTolerance is set to 0 - * unless specified, and rebufferingGoal to 0.01 unless specified at the same - * time. + * lowLatencyMode is set to true, it changes the default config values for + * other things, see: docs/tutorials/config.md * @property {boolean} autoLowLatencyMode * If the stream is low latency and the user has not configured the * lowLatencyMode, but if it has been configured to activate the diff --git a/lib/player.js b/lib/player.js index 8d21fcd66c..d9d6615082 100644 --- a/lib/player.js +++ b/lib/player.js @@ -3359,10 +3359,11 @@ shaka.Player = class extends shaka.util.FakeEventTarget { } // If lowLatencyMode is enabled, and inaccurateManifestTolerance and - // rebufferingGoal and segmentPrefetchLimit and baseDelay are not - // specified, set inaccurateManifestTolerance to 0 and rebufferingGoal - // to 0.01 and segmentPrefetchLimit to 2 and updateIntervalSeconds to - // 0.1 and baseDelay to 100 by default for low latency streaming. + // rebufferingGoal and segmentPrefetchLimit and baseDelay and + // autoCorrectDrift are not specified, set inaccurateManifestTolerance to 0 + // and rebufferingGoal to 0.01 and segmentPrefetchLimit to 2 and + // updateIntervalSeconds to 0.1 and baseDelay to 100 and autoCorrectDrift + // to false by default for low latency streaming. if (config['streaming'] && config['streaming']['lowLatencyMode']) { if (config['streaming']['inaccurateManifestTolerance'] == undefined) { config['streaming']['inaccurateManifestTolerance'] = 0; @@ -3385,6 +3386,12 @@ shaka.Player = class extends shaka.util.FakeEventTarget { if (config['manifest'] == undefined) { config['manifest'] = {}; } + if (config['manifest']['dash'] == undefined) { + config['manifest']['dash'] = {}; + } + if (config['manifest']['dash']['autoCorrectDrift'] == undefined) { + config['manifest']['dash']['autoCorrectDrift'] = false; + } if (config['manifest']['retryParameters'] == undefined) { config['manifest']['retryParameters'] = {}; } diff --git a/test/player_unit.js b/test/player_unit.js index be03853c72..07192f09ec 100644 --- a/test/player_unit.js +++ b/test/player_unit.js @@ -1220,6 +1220,9 @@ describe('Player', () => { }, }, manifest: { + dash: { + autoCorrectDrift: true, + }, retryParameters: { baseDelay: 2000, }, @@ -1238,6 +1241,8 @@ describe('Player', () => { .toBe(10); expect(player.getConfiguration().streaming.retryParameters.baseDelay) .toBe(2000); + expect(player.getConfiguration().manifest.dash.autoCorrectDrift) + .toBe(true); expect(player.getConfiguration().manifest.retryParameters.baseDelay) .toBe(2000); expect(player.getConfiguration().drm.retryParameters.baseDelay) @@ -1256,6 +1261,8 @@ describe('Player', () => { .toBe(0.1); expect(player.getConfiguration().streaming.retryParameters.baseDelay) .toBe(100); + expect(player.getConfiguration().manifest.dash.autoCorrectDrift) + .toBe(false); expect(player.getConfiguration().manifest.retryParameters.baseDelay) .toBe(100); expect(player.getConfiguration().drm.retryParameters.baseDelay)