From 689a4f6946e47ddf4871fd43bbd1284a4dc79e68 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 5 Dec 2019 09:21:09 +0100 Subject: Pause the video when a modal is opened --- .../src/app/videos/+video-watch/video-watch.component.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'client/src/app/videos/+video-watch/video-watch.component.ts') 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 80aa8ebe4..0007331f8 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -203,10 +203,14 @@ export class VideoWatchComponent implements OnInit, OnDestroy { } showSupportModal () { + this.pausePlayer() + this.videoSupportModal.show() } showShareModal () { + this.pausePlayer() + this.videoShareModal.show(this.currentTime) } @@ -227,6 +231,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { } } + onModalOpened () { + this.pausePlayer() + } + onVideoRemoved () { this.redirectService.redirectToHomepage() } @@ -622,4 +630,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { ] if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys) } + + private pausePlayer () { + if (!this.player) return + + this.player.pause() + } } -- cgit v1.2.3