mirror of
https://github.com/iv-org/invidious.git
synced 2024-06-07 19:40:52 +00:00
Roll back playback rate index to 0 when at max speed
Previously, when clicking on speed control button after max speed was selected it would reset to 1x. This behaviour is not inline with what originally was, so it was changed to roll back to index 0 (slowest speed) when clicking on speed control after max speed selected.
This commit is contained in:
parent
bed5f70d77
commit
e94fc2154b
@ -592,15 +592,14 @@ function increase_playback_rate(steps) {
|
||||
else {
|
||||
const maxIndex = options.playbackRates.length - 1;
|
||||
const curIndex = options.playbackRates.indexOf(player.playbackRate());
|
||||
// Reset speed if maximum selected
|
||||
if (curIndex == maxIndex) {
|
||||
speed = 1;
|
||||
}
|
||||
else{
|
||||
let newIndex = curIndex + steps;
|
||||
newIndex = helpers.clamp(newIndex, 0, maxIndex);
|
||||
speed = options.playbackRates[newIndex];
|
||||
}
|
||||
let newIndex = curIndex;
|
||||
// Set speed to minimum if at max speed
|
||||
if (curIndex >= maxIndex)
|
||||
newIndex = 0;
|
||||
else
|
||||
newIndex = curIndex + steps;
|
||||
|
||||
speed = options.playbackRates[newIndex];
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user