diff options
Diffstat (limited to 'client/src/app/+videos/+video-watch/video-watch.component.ts')
-rw-r--r-- | client/src/app/+videos/+video-watch/video-watch.component.ts | 23 |
1 files changed, 22 insertions, 1 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 d8136ab4f..33f998282 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts | |||
@@ -236,9 +236,18 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
236 | } | 236 | } |
237 | 237 | ||
238 | showSupportModal () { | 238 | showSupportModal () { |
239 | // Check video was playing before opening support modal | ||
240 | const isVideoPlaying = this.isPlaying() | ||
241 | |||
239 | this.pausePlayer() | 242 | this.pausePlayer() |
240 | 243 | ||
241 | this.videoSupportModal.show() | 244 | const modalRef = this.videoSupportModal.show() |
245 | |||
246 | modalRef.result.then(() => { | ||
247 | if (isVideoPlaying) { | ||
248 | this.resumePlayer() | ||
249 | } | ||
250 | }) | ||
242 | } | 251 | } |
243 | 252 | ||
244 | showShareModal () { | 253 | showShareModal () { |
@@ -757,6 +766,18 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
757 | this.player.pause() | 766 | this.player.pause() |
758 | } | 767 | } |
759 | 768 | ||
769 | private resumePlayer () { | ||
770 | if (!this.player) return | ||
771 | |||
772 | this.player.play() | ||
773 | } | ||
774 | |||
775 | private isPlaying () { | ||
776 | if (!this.player) return | ||
777 | |||
778 | return !this.player.paused() | ||
779 | } | ||
780 | |||
760 | private initHotkeys () { | 781 | private initHotkeys () { |
761 | this.hotkeys = [ | 782 | this.hotkeys = [ |
762 | // These hotkeys are managed by the player | 783 | // These hotkeys are managed by the player |