Skip to content

Commit

Permalink
fix(UI): Use trickPlay method to control the playback rate (#7580)
Browse files Browse the repository at this point in the history
This change allows the AbrManager to be correctly informed of the new
rate. See:
https://github.com/shaka-project/shaka-player/blob/main/lib/player.js#L4681
  • Loading branch information
avelad committed Nov 15, 2024
1 parent 4737a22 commit 0c3ef19
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/playback_rate_selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,12 @@ shaka.ui.PlaybackRateSelection = class extends shaka.ui.SettingsMenu {
button.appendChild(span);

this.eventManager.listen(button, 'click', () => {
this.video.playbackRate = this.playbackRates_.get(rateStr);
this.video.defaultPlaybackRate = this.playbackRates_.get(rateStr);
const rate = this.playbackRates_.get(rateStr);
if (rate == 1) {
this.player.cancelTrickPlay();
} else {
this.player.trickPlay(rate, /* useTrickPlayTrack= */ false);
}
});

this.menu.appendChild(button);
Expand Down

0 comments on commit 0c3ef19

Please sign in to comment.