aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2021-04-08 13:37:57 +0200
committerGitHub <noreply@github.com>2021-04-08 13:37:57 +0200
commitca873292899c9a822a236556993916d98da14913 (patch)
tree37778ad1f64167cbd482b5765f6ad63a3d779dcd /client
parent97c116edf9b02ed9c85b2cf0fc33a4e7f7266d78 (diff)
downloadPeerTube-ca873292899c9a822a236556993916d98da14913.tar.gz
PeerTube-ca873292899c9a822a236556993916d98da14913.tar.zst
PeerTube-ca873292899c9a822a236556993916d98da14913.zip
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
Diffstat (limited to 'client')
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.html2
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.ts37
2 files changed, 2 insertions, 37 deletions
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 @@
142 <ng-container *ngIf="isUserLoggedIn()"> 142 <ng-container *ngIf="isUserLoggedIn()">
143 <my-video-actions-dropdown 143 <my-video-actions-dropdown
144 placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions" 144 placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions"
145 [displayOptions]="videoActionsOptions" (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()" 145 [displayOptions]="videoActionsOptions" (videoRemoved)="onVideoRemoved()"
146 ></my-video-actions-dropdown> 146 ></my-video-actions-dropdown>
147 </ng-container> 147 </ng-container>
148 </div> 148 </div>
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 {
284 } 284 }
285 285
286 showSupportModal () { 286 showSupportModal () {
287 // Check video was playing before opening support modal 287 this.supportModal.show()
288 const isVideoPlaying = this.isPlaying()
289
290 this.pausePlayer()
291
292 const modalRef = this.supportModal.show()
293
294 modalRef.result.then(() => {
295 if (isVideoPlaying) {
296 this.resumePlayer()
297 }
298 })
299 } 288 }
300 289
301 showShareModal () { 290 showShareModal () {
302 this.pausePlayer()
303
304 this.videoShareModal.show(this.currentTime, this.videoWatchPlaylist.currentPlaylistPosition) 291 this.videoShareModal.show(this.currentTime, this.videoWatchPlaylist.currentPlaylistPosition)
305 } 292 }
306 293
@@ -323,10 +310,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
323 } 310 }
324 } 311 }
325 312
326 onModalOpened () {
327 this.pausePlayer()
328 }
329
330 onVideoRemoved () { 313 onVideoRemoved () {
331 this.redirectService.redirectToHomepage() 314 this.redirectService.redirectToHomepage()
332 } 315 }
@@ -884,24 +867,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
884 return { playerMode: mode, playerOptions: options } 867 return { playerMode: mode, playerOptions: options }
885 } 868 }
886 869
887 private pausePlayer () {
888 if (!this.player) return
889
890 this.player.pause()
891 }
892
893 private resumePlayer () {
894 if (!this.player) return
895
896 this.player.play()
897 }
898
899 private isPlaying () {
900 if (!this.player) return
901
902 return !this.player.paused()
903 }
904
905 private async subscribeToLiveEventsIfNeeded (oldVideo: VideoDetails, newVideo: VideoDetails) { 870 private async subscribeToLiveEventsIfNeeded (oldVideo: VideoDetails, newVideo: VideoDetails) {
906 if (!this.liveVideosSub) { 871 if (!this.liveVideosSub) {
907 this.liveVideosSub = this.buildLiveEventsSubscription() 872 this.liveVideosSub = this.buildLiveEventsSubscription()