diff --git a/lib/player.js b/lib/player.js index ab6fcb289b..a3efd75c21 100644 --- a/lib/player.js +++ b/lib/player.js @@ -4454,9 +4454,10 @@ shaka.Player = class extends shaka.util.FakeEventTarget { * beginning or end of the seekable range for the content. * * @param {number} rate + * @param {boolean=} useTrickPlayTrack * @export */ - trickPlay(rate) { + trickPlay(rate, useTrickPlayTrack = true) { // A playbackRate of 0 is used internally when we are in a buffering state, // and doesn't make sense for trick play. If you set a rate of 0 for trick // play, we will reject it and issue a warning. If it happens during a @@ -4478,7 +4479,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget { if (this.loadMode_ == shaka.Player.LoadMode.MEDIA_SOURCE) { this.abrManager_.playbackRateChanged(rate); - this.streamingEngine_.setTrickPlay(Math.abs(rate) > 1); + this.streamingEngine_.setTrickPlay( + useTrickPlayTrack && Math.abs(rate) > 1); } if (this.isLive()) { this.trickPlayEventManager_.listen(this.video_, 'timeupdate', () => { @@ -6502,7 +6504,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget { shaka.log.debug('Buffer fullness ratio (' + bufferFullness + ') ' + 'is less than the vodDynamicPlaybackRateBufferRatio (' + bufferThreshold + '). Updating playbackRate to ' + minPlaybackRate); - this.trickPlay(minPlaybackRate); + this.trickPlay(minPlaybackRate, /* useTrickPlayTrack= */ false); } } else if (bufferFullness == 1) { if (playbackRate !== this.playRateController_.getDefaultRate()) { @@ -6629,7 +6631,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget { timeSinceLastRebuffer + 's) ' + 'is less than the live sync panicThreshold (' + panicThreshold + 's). Updating playbackRate to ' + minPlaybackRate); - this.trickPlay(minPlaybackRate); + this.trickPlay(minPlaybackRate, /* useTrickPlayTrack= */ false); } } else if (maxLatency && maxPlaybackRate && (latency - offset) > maxLatency) { @@ -6637,7 +6639,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget { shaka.log.debug('Latency (' + latency + 's) is greater than ' + 'live sync maxLatency (' + maxLatency + 's). ' + 'Updating playbackRate to ' + maxPlaybackRate); - this.trickPlay(maxPlaybackRate); + this.trickPlay(maxPlaybackRate, /* useTrickPlayTrack= */ false); } this.targetLatencyReached_ = null; } else if (minLatency && minPlaybackRate && @@ -6646,7 +6648,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget { shaka.log.debug('Latency (' + latency + 's) is smaller than ' + 'live sync minLatency (' + minLatency + 's). ' + 'Updating playbackRate to ' + minPlaybackRate); - this.trickPlay(minPlaybackRate); + this.trickPlay(minPlaybackRate, /* useTrickPlayTrack= */ false); } this.targetLatencyReached_ = null; } else if (playbackRate !== this.playRateController_.getDefaultRate()) {