Skip to content

Commit

Permalink
fix: Looser tolerance for ending trick play at edge of seek range. (#…
Browse files Browse the repository at this point in the history
…6422)

Fixes #6421
  • Loading branch information
david-hm-morgan authored and avelad committed Apr 10, 2024
1 parent ac12b87 commit 66924d0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/player.js
Expand Up @@ -3620,12 +3620,16 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
const currentTime = this.video_.currentTime;
const seekRange = this.seekRange();
const safeSeekOffset = this.config_.streaming.safeSeekOffset;

// Cancel trick play if we hit the beginning or end of the seekable
// (Sub-second accuracy not required here)
if (rate > 0) {
if (currentTime >= seekRange.end) {
if (Math.floor(currentTime) >= Math.floor(seekRange.end)) {
this.cancelTrickPlay();
}
} else {
if (currentTime <= (seekRange.start + safeSeekOffset)) {
if (Math.floor(currentTime) <=
Math.floor(seekRange.start + safeSeekOffset)) {
this.cancelTrickPlay();
}
}
Expand Down

0 comments on commit 66924d0

Please sign in to comment.