aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos')
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.scss1
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts38
2 files changed, 22 insertions, 17 deletions
diff --git a/client/src/app/videos/+video-watch/video-watch.component.scss b/client/src/app/videos/+video-watch/video-watch.component.scss
index 8ca5c4118..bada9bae8 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.scss
+++ b/client/src/app/videos/+video-watch/video-watch.component.scss
@@ -18,6 +18,7 @@ $player-factor: 1.7; // 16/9
18 width: 100% !important; 18 width: 100% !important;
19 height: auto !important; 19 height: auto !important;
20 max-height: 300px !important; 20 max-height: 300px !important;
21 max-width: initial;
21 border-bottom: 1px solid $separator-border-color !important; 22 border-bottom: 1px solid $separator-border-color !important;
22} 23}
23 24
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 d8ba4df89..55109dc32 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -119,23 +119,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
119 if (videoId) this.loadVideo(videoId) 119 if (videoId) this.loadVideo(videoId)
120 }) 120 })
121 121
122 this.hotkeys = [ 122 this.initHotkeys()
123 new Hotkey('shift+l', (event: KeyboardEvent): boolean => {
124 this.setLike()
125 return false
126 }, undefined, this.i18n('Like the video')),
127 new Hotkey('shift+d', (event: KeyboardEvent): boolean => {
128 this.setDislike()
129 return false
130 }, undefined, this.i18n('Dislike the video')),
131 new Hotkey('shift+s', (event: KeyboardEvent): boolean => {
132 this.subscribeButton.subscribed ?
133 this.subscribeButton.unsubscribe() :
134 this.subscribeButton.subscribe()
135 return false
136 }, undefined, this.i18n('Subscribe to the account'))
137 ]
138 if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys)
139 } 123 }
140 124
141 ngOnDestroy () { 125 ngOnDestroy () {
@@ -569,4 +553,24 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
569 } 553 }
570 } 554 }
571 } 555 }
556
557 private initHotkeys () {
558 this.hotkeys = [
559 new Hotkey('shift+l', (event: KeyboardEvent): boolean => {
560 this.setLike()
561 return false
562 }, undefined, this.i18n('Like the video')),
563 new Hotkey('shift+d', (event: KeyboardEvent): boolean => {
564 this.setDislike()
565 return false
566 }, undefined, this.i18n('Dislike the video')),
567 new Hotkey('shift+s', (event: KeyboardEvent): boolean => {
568 this.subscribeButton.subscribed ?
569 this.subscribeButton.unsubscribe() :
570 this.subscribeButton.subscribe()
571 return false
572 }, undefined, this.i18n('Subscribe to the account'))
573 ]
574 if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys)
575 }
572} 576}