aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-06 09:55:36 +0100
committerChocobozzz <me@florianbigard.com>2019-12-06 10:05:49 +0100
commit941c5eac1751ef93500d6afa58c4575f777dbff9 (patch)
tree765c99a830ff56f426d00e6155b1dad21e91269e /client
parent0912f1b4caaa7394516567044f896132ad991131 (diff)
downloadPeerTube-941c5eac1751ef93500d6afa58c4575f777dbff9.tar.gz
PeerTube-941c5eac1751ef93500d6afa58c4575f777dbff9.tar.zst
PeerTube-941c5eac1751ef93500d6afa58c4575f777dbff9.zip
Add missing hotkeys to the watch page
Diffstat (limited to 'client')
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts58
1 files changed, 38 insertions, 20 deletions
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts
index adf6dc12f..eee7adfd8 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -551,26 +551,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
551 } 551 }
552 } 552 }
553 553
554 private initHotkeys () {
555 this.hotkeys = [
556 new Hotkey('shift+l', () => {
557 this.setLike()
558 return false
559 }, undefined, this.i18n('Like the video')),
560
561 new Hotkey('shift+d', () => {
562 this.setDislike()
563 return false
564 }, undefined, this.i18n('Dislike the video')),
565
566 new Hotkey('shift+s', () => {
567 this.subscribeButton.subscribed ? this.subscribeButton.unsubscribe() : this.subscribeButton.subscribe()
568 return false
569 }, undefined, this.i18n('Subscribe to the account'))
570 ]
571 if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys)
572 }
573
574 private buildPlayerManagerOptions (params: { 554 private buildPlayerManagerOptions (params: {
575 video: VideoDetails, 555 video: VideoDetails,
576 videoCaptions: VideoCaption[], 556 videoCaptions: VideoCaption[],
@@ -667,4 +647,42 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
667 647
668 this.player.pause() 648 this.player.pause()
669 } 649 }
650
651 private initHotkeys () {
652 this.hotkeys = [
653 new Hotkey('shift+l', () => {
654 this.setLike()
655 return false
656 }, undefined, this.i18n('Like the video')),
657
658 new Hotkey('shift+d', () => {
659 this.setDislike()
660 return false
661 }, undefined, this.i18n('Dislike the video')),
662
663 new Hotkey('shift+s', () => {
664 this.subscribeButton.subscribed ? this.subscribeButton.unsubscribe() : this.subscribeButton.subscribe()
665 return false
666 }, undefined, this.i18n('Subscribe to the account')),
667
668 // These hotkeys are managed by the player
669 new Hotkey('f', e => e, undefined, this.i18n('Enter/exit fullscreen (requires player focus)')),
670 new Hotkey('space', e => e, undefined, this.i18n('Play/Pause the video (requires player focus)')),
671 new Hotkey('m', e => e, undefined, this.i18n('Mute/unmute the video (requires player focus)')),
672
673 new Hotkey('0-9', e => e, undefined, this.i18n('Skip to a percentage of the video: 0 is 0% and 9 is 90% (requires player focus)')),
674
675 new Hotkey('up', e => e, undefined, this.i18n('Increase the volume (requires player focus)')),
676 new Hotkey('down', e => e, undefined, this.i18n('Decrease the volume (requires player focus)')),
677
678 new Hotkey('right', e => e, undefined, this.i18n('Seek the video forward (requires player focus)')),
679 new Hotkey('left', e => e, undefined, this.i18n('Seek the video backward (requires player focus)')),
680
681 new Hotkey('>', e => e, undefined, this.i18n('Increase playback rate (requires player focus)')),
682 new Hotkey('<', e => e, undefined, this.i18n('Decrease playback rate (requires player focus)')),
683
684 new Hotkey('.', e => e, undefined, this.i18n('Navigate in the video frame by frame (requires player focus)'))
685 ]
686 if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys)
687 }
670} 688}