Skip to content

Commit

Permalink
feat(UI): Disable forward and rewind with arrows while seekbar not ac…
Browse files Browse the repository at this point in the history
…tive (#6049)

Closes #6040
  • Loading branch information
avelad committed Jan 9, 2024
1 parent a371f43 commit c189922
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/controls.js
Expand Up @@ -1446,15 +1446,17 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
case 'ArrowLeft':
// If it's not focused on the volume bar, move the seek time backward
// for a few sec. Otherwise, the volume will be adjusted automatically.
if (this.seekBar_ && !isVolumeBar && keyboardSeekDistance > 0) {
if (this.seekBar_ && isSeekBar && !isVolumeBar &&
keyboardSeekDistance > 0) {
event.preventDefault();
this.seek_(this.seekBar_.getValue() - keyboardSeekDistance);
}
break;
case 'ArrowRight':
// If it's not focused on the volume bar, move the seek time forward
// for a few sec. Otherwise, the volume will be adjusted automatically.
if (this.seekBar_ && !isVolumeBar && keyboardSeekDistance > 0) {
if (this.seekBar_ && isSeekBar && !isVolumeBar &&
keyboardSeekDistance > 0) {
event.preventDefault();
this.seek_(this.seekBar_.getValue() + keyboardSeekDistance);
}
Expand Down

0 comments on commit c189922

Please sign in to comment.