From ca873292899c9a822a236556993916d98da14913 Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Thu, 8 Apr 2021 13:37:57 +0200 Subject: Don't pause video upon modal open (#3909) * client: dont pause video upon modal open closes #3816 * client(video/watch): remove obsolete code * gitignore: add vscode and vim swp files --- .gitignore | 2 ++ .../+video-watch/video-watch.component.html | 2 +- .../+videos/+video-watch/video-watch.component.ts | 37 +--------------------- 3 files changed, 4 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 07b2fb7ef..98f337490 100644 --- a/.gitignore +++ b/.gitignore @@ -30,9 +30,11 @@ yarn-error.log # IDE /*.sublime-project /*.sublime-workspace +/*.vscode /**/.idea /dist /PeerTube.iml +*.swp # Zanata /.zanata-cache diff --git a/client/src/app/+videos/+video-watch/video-watch.component.html b/client/src/app/+videos/+video-watch/video-watch.component.html index 5d417609a..99103c2c3 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.html +++ b/client/src/app/+videos/+video-watch/video-watch.component.html @@ -142,7 +142,7 @@ 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 7f3ceeebc..de5fb4ed0 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts @@ -284,23 +284,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { } showSupportModal () { - // Check video was playing before opening support modal - const isVideoPlaying = this.isPlaying() - - this.pausePlayer() - - const modalRef = this.supportModal.show() - - modalRef.result.then(() => { - if (isVideoPlaying) { - this.resumePlayer() - } - }) + this.supportModal.show() } showShareModal () { - this.pausePlayer() - this.videoShareModal.show(this.currentTime, this.videoWatchPlaylist.currentPlaylistPosition) } @@ -323,10 +310,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy { } } - onModalOpened () { - this.pausePlayer() - } - onVideoRemoved () { this.redirectService.redirectToHomepage() } @@ -884,24 +867,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy { return { playerMode: mode, playerOptions: options } } - private pausePlayer () { - if (!this.player) return - - this.player.pause() - } - - private resumePlayer () { - if (!this.player) return - - this.player.play() - } - - private isPlaying () { - if (!this.player) return - - return !this.player.paused() - } - private async subscribeToLiveEventsIfNeeded (oldVideo: VideoDetails, newVideo: VideoDetails) { if (!this.liveVideosSub) { this.liveVideosSub = this.buildLiveEventsSubscription() -- cgit v1.2.3