From: Chocobozzz Date: Tue, 21 May 2019 08:05:12 +0000 (+0200) Subject: Merge branch 'feature/audio-upload' into develop X-Git-Tag: v1.4.0-rc.1~233 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=73b3aa6429dfb2e31628fa09a479dce318289d7d;p=oweals%2Fpeertube.git Merge branch 'feature/audio-upload' into develop --- 73b3aa6429dfb2e31628fa09a479dce318289d7d diff --cc client/src/app/videos/+video-watch/video-watch.component.ts index 631504eab,d8ba4df89..55109dc32 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@@ -545,28 -561,12 +545,32 @@@ export class VideoWatchComponent implem private flushPlayer () { // Remove player if it exists if (this.player) { - this.player.dispose() - this.player = undefined + try { + this.player.dispose() + this.player = undefined + } catch (err) { + console.error('Cannot dispose player.', err) + } } } + + private initHotkeys () { + this.hotkeys = [ + new Hotkey('shift+l', (event: KeyboardEvent): boolean => { + this.setLike() + return false + }, undefined, this.i18n('Like the video')), + new Hotkey('shift+d', (event: KeyboardEvent): boolean => { + this.setDislike() + return false + }, undefined, this.i18n('Dislike the video')), + new Hotkey('shift+s', (event: KeyboardEvent): boolean => { + this.subscribeButton.subscribed ? + this.subscribeButton.unsubscribe() : + this.subscribeButton.subscribe() + return false + }, undefined, this.i18n('Subscribe to the account')) + ] + if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys) + } }