Skip to content

Commit

Permalink
skip checking for drm in variants and set last time jump was done
Browse files Browse the repository at this point in the history
  • Loading branch information
jobispo committed Apr 10, 2024
1 parent 712111e commit 22626ca
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 40 deletions.
14 changes: 7 additions & 7 deletions dist/shaka-player.compiled.debug.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/shaka-player.compiled.debug.map

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions dist/shaka-player.compiled.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/shaka-player.compiled.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions dist/shaka-player.ui.debug.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/shaka-player.ui.debug.map

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions dist/shaka-player.ui.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/shaka-player.ui.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion lib/media/gap_jumping_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ shaka.media.GapJumpingController = class {
/** @private {boolean} */
this.didFireLargeGap_ = false;

/** @private {number} */
this.lastJumpTimestamp_ = 0;

/**
* The stall detector tries to keep the playhead moving forward. It is
* managed by the gap-jumping controller to avoid conflicts. On some
Expand Down Expand Up @@ -143,6 +146,10 @@ shaka.media.GapJumpingController = class {
if (this.video_.readyState == 0) {
return;
}
// Don't gap jump if the last jump was too recent.
if (Date.now() - this.lastJumpTimestamp_ < 5000) {
return;
}
// Do not gap jump if seeking has begun, but the seeking event has not
// yet fired for this particular seek.
if (this.video_.seeking) {
Expand Down Expand Up @@ -241,7 +248,7 @@ shaka.media.GapJumpingController = class {
'Jumping forward', jumpSize, 'seconds because of gap starting at',
buffered.end(gapIndex - 1), 'and ending at', jumpTo);
}

this.lastJumpTimestamp_ = Date.now();
this.video_.currentTime = jumpTo;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -5409,7 +5409,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
for (const keyId of stream.keyIds) {
const keyStatus = keyStatusMap[isGlobalStatus ? '00' : keyId];
variant.allowedByKeySystem = variant.allowedByKeySystem &&
!!keyStatus && !restrictedStatuses.includes(keyStatus);
!restrictedStatuses.includes(keyStatus);
}
}

Expand Down

0 comments on commit 22626ca

Please sign in to comment.