Skip to content

Commit a883dfd

Browse files
committed
[Settings] Add enableSeekDecorrelationFix
Allows disabling the workaround for live playback start (#3750)
1 parent 5bb6b28 commit a883dfd

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ declare namespace dashjs {
176176
keepProtectionMediaKeys?: boolean,
177177
},
178178
buffer?: {
179+
enableSeekDecorrelationFix?: boolean,
179180
fastSwitchEnabled?: boolean,
180181
flushBufferAtTrackSwitch?: boolean,
181182
reuseExistingSourceBuffers?: boolean,

src/core/Settings.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ import {HTTPRequest} from '../streaming/vo/metrics/HTTPRequest';
8484
* keepProtectionMediaKeys: false
8585
* },
8686
* buffer: {
87+
enableSeekDecorrelationFix: true,
8788
* fastSwitchEnabled: true,
8889
* flushBufferAtTrackSwitch: false,
8990
* reuseExistingSourceBuffers: true,
@@ -239,6 +240,11 @@ import {HTTPRequest} from '../streaming/vo/metrics/HTTPRequest';
239240

240241
/**
241242
* @typedef {Object} Buffer
243+
* @property {boolean} [enableSeekDecorrelationFix=true]
244+
* Enables a workaround for playback start on some devices, e.g. WebOS 4.9.
245+
* It is necessary because some browsers do not support setting currentTime on video element to a value that is outside of current buffer.
246+
*
247+
* If you experience unexpected seeking triggered by BufferController, you can try setting this value to false.
242248
* @property {boolean} [fastSwitchEnabled=true]
243249
* When enabled, after an ABR up-switch in quality, instead of requesting and appending the next fragment at the end of the current buffer range it is requested and appended closer to the current time.
244250
*
@@ -761,6 +767,7 @@ function Settings() {
761767
keepProtectionMediaKeys: false
762768
},
763769
buffer: {
770+
enableSeekDecorrelationFix: true,
764771
fastSwitchEnabled: true,
765772
flushBufferAtTrackSwitch: false,
766773
reuseExistingSourceBuffers: true,

src/streaming/controllers/BufferController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ function BufferController(config) {
346346
range = getRangeAt(seekTarget, segmentDuration);
347347
if (!range) return;
348348

349-
if (Math.abs(currentTime - seekTarget) > segmentDuration) {
349+
if (settings.get().streaming.buffer.enableSeekDecorrelationFix && Math.abs(currentTime - seekTarget) > segmentDuration) {
350350
// If current video model time is decorrelated from seek target (and appended buffer) then seek video element
351351
// (in case of live streams on some browsers/devices for which we can't set video element time at unavalaible range)
352352

0 commit comments

Comments
 (0)