Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(UI): Disable forward and rewind with arrows while seekbar not active #6049

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions ui/controls.js
Original file line number Diff line number Diff line change
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