]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-watch/video-watch.component.ts
Fix playlist layout on mobile
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-watch / video-watch.component.ts
index d8136ab4ff36dadd56dd8682dffb7a6b00cba271..33f998282628d844d5c0156e0b3f1479953aef58 100644 (file)
@@ -236,9 +236,18 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
   }
 
   showSupportModal () {
+    // Check video was playing before opening support modal
+    const isVideoPlaying = this.isPlaying()
+
     this.pausePlayer()
 
-    this.videoSupportModal.show()
+    const modalRef = this.videoSupportModal.show()
+
+    modalRef.result.then(() => {
+      if (isVideoPlaying) {
+        this.resumePlayer()
+      }
+    })
   }
 
   showShareModal () {
@@ -757,6 +766,18 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
     this.player.pause()
   }
 
+  private resumePlayer () {
+    if (!this.player) return
+
+    this.player.play()
+  }
+
+  private isPlaying () {
+    if (!this.player) return
+
+    return !this.player.paused()
+  }
+
   private initHotkeys () {
     this.hotkeys = [
       // These hotkeys are managed by the player