feat(shortcuts): removed volume shortcuts & updated CHANGELOG
This commit is contained in:
parent
9f7a2e2611
commit
3a7348af64
2 changed files with 5 additions and 16 deletions
|
@ -26,6 +26,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
- Subscription and file view counts ([#2920](https://github.com/lbryio/lbry-desktop/pull/2920))
|
||||
- Pagination on Library, Publishes, and Transactions page ([#2923](https://github.com/lbryio/lbry-desktop/pull/2923))
|
||||
- Granular balance information ([#2916](https://github.com/lbryio/lbry-desktop/pull/2916))
|
||||
- Keyboard shortcuts for the following actions: ([#2999](https://github.com/lbryio/lbry-desktop/pull/2999))
|
||||
- `→` to Seek Forward
|
||||
- `←` to Seek Backward
|
||||
- `f` to Going Fullscreen
|
||||
- `m` to Mute/Unmute
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
@ -9,19 +9,14 @@ const SPACE_BAR_KEYCODE = 32;
|
|||
const SMALL_F_KEYCODE = 70;
|
||||
const SMALL_M_KEYCODE = 77;
|
||||
const ARROW_LEFT_KEYCODE = 37;
|
||||
const ARROW_UP_KEYCODE = 38;
|
||||
const ARROW_RIGHT_KEYCODE = 39;
|
||||
const ARROW_DOWN_KEYCODE = 40;
|
||||
|
||||
const FULLSCREEN_KEYCODE = SMALL_F_KEYCODE;
|
||||
const MUTE_KEYCODE = SMALL_M_KEYCODE;
|
||||
const VOLUME_INCREASE_KEYCODE = ARROW_UP_KEYCODE;
|
||||
const VOLUME_DECREASE_KEYCODE = ARROW_DOWN_KEYCODE;
|
||||
|
||||
const SEEK_FORWARD_KEYCODE = ARROW_RIGHT_KEYCODE;
|
||||
const SEEK_BACKWARD_KEYCODE = ARROW_LEFT_KEYCODE;
|
||||
|
||||
const VOLUME_STEP = 0.1; // Volume range is 0 to 1
|
||||
const SEEK_STEP = 10; // time to seek in seconds
|
||||
|
||||
const VIDEO_JS_OPTIONS = {
|
||||
|
@ -151,17 +146,6 @@ function VideoViewer(props: Props) {
|
|||
videoNode.muted = !videoNode.muted;
|
||||
}
|
||||
|
||||
// Volume Shortcuts
|
||||
const volume = videoNode.volume;
|
||||
if (e.keyCode === VOLUME_INCREASE_KEYCODE) {
|
||||
const newVolume = volume + VOLUME_STEP;
|
||||
videoNode.volume = newVolume > 1 ? 1 : newVolume;
|
||||
}
|
||||
if (e.keyCode === VOLUME_DECREASE_KEYCODE) {
|
||||
const newVolume = volume - VOLUME_STEP;
|
||||
videoNode.volume = newVolume < 0 ? 0 : newVolume;
|
||||
}
|
||||
|
||||
// Seeking Shortcuts
|
||||
const duration = videoNode.duration;
|
||||
const currentTime = videoNode.currentTime;
|
||||
|
|
Loading…
Reference in a new issue