aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-05 09:21:09 +0100
committerChocobozzz <me@florianbigard.com>2019-12-05 09:21:09 +0100
commit689a4f6946e47ddf4871fd43bbd1284a4dc79e68 (patch)
treecad066d9bd2a4a5642f2933f06a9a5d9047cbc34
parent25266908666d4d465e1c8ec90135eaa00c91732e (diff)
downloadPeerTube-689a4f6946e47ddf4871fd43bbd1284a4dc79e68.tar.gz
PeerTube-689a4f6946e47ddf4871fd43bbd1284a4dc79e68.tar.zst
PeerTube-689a4f6946e47ddf4871fd43bbd1284a4dc79e68.zip
Pause the video when a modal is opened
-rw-r--r--client/src/app/shared/video/video-actions-dropdown.component.ts9
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.html3
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts14
3 files changed, 25 insertions, 1 deletions
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.ts b/client/src/app/shared/video/video-actions-dropdown.component.ts
index 7f3e25d0a..80407098b 100644
--- a/client/src/app/shared/video/video-actions-dropdown.component.ts
+++ b/client/src/app/shared/video/video-actions-dropdown.component.ts
@@ -57,6 +57,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
57 @Output() videoRemoved = new EventEmitter() 57 @Output() videoRemoved = new EventEmitter()
58 @Output() videoUnblacklisted = new EventEmitter() 58 @Output() videoUnblacklisted = new EventEmitter()
59 @Output() videoBlacklisted = new EventEmitter() 59 @Output() videoBlacklisted = new EventEmitter()
60 @Output() modalOpened = new EventEmitter()
60 61
61 videoActions: DropdownAction<{ video: Video }>[][] = [] 62 videoActions: DropdownAction<{ video: Video }>[][] = []
62 63
@@ -102,14 +103,20 @@ export class VideoActionsDropdownComponent implements OnChanges {
102 /* Show modals */ 103 /* Show modals */
103 104
104 showDownloadModal () { 105 showDownloadModal () {
106 this.modalOpened.emit()
107
105 this.videoDownloadModal.show(this.video as VideoDetails) 108 this.videoDownloadModal.show(this.video as VideoDetails)
106 } 109 }
107 110
108 showReportModal () { 111 showReportModal () {
112 this.modalOpened.emit()
113
109 this.videoReportModal.show() 114 this.videoReportModal.show()
110 } 115 }
111 116
112 showBlacklistModal () { 117 showBlacklistModal () {
118 this.modalOpened.emit()
119
113 this.videoBlacklistModal.show() 120 this.videoBlacklistModal.show()
114 } 121 }
115 122
@@ -160,6 +167,8 @@ export class VideoActionsDropdownComponent implements OnChanges {
160 } 167 }
161 168
162 async removeVideo () { 169 async removeVideo () {
170 this.modalOpened.emit()
171
163 const res = await this.confirmService.confirm(this.i18n('Do you really want to delete this video?'), this.i18n('Delete')) 172 const res = await this.confirmService.confirm(this.i18n('Do you really want to delete this video?'), this.i18n('Delete'))
164 if (res === false) return 173 if (res === false) return
165 174
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 647cc3c57..38ad4e948 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.html
+++ b/client/src/app/videos/+video-watch/video-watch.component.html
@@ -98,7 +98,8 @@
98 </div> 98 </div>
99 99
100 <my-video-actions-dropdown 100 <my-video-actions-dropdown
101 placement="top" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" (videoRemoved)="onVideoRemoved()" 101 placement="top" buttonDirection="horizontal" [buttonStyled]="true" [video]="video"
102 (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()"
102 ></my-video-actions-dropdown> 103 ></my-video-actions-dropdown>
103 </div> 104 </div>
104 105
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 {
203 } 203 }
204 204
205 showSupportModal () { 205 showSupportModal () {
206 this.pausePlayer()
207
206 this.videoSupportModal.show() 208 this.videoSupportModal.show()
207 } 209 }
208 210
209 showShareModal () { 211 showShareModal () {
212 this.pausePlayer()
213
210 this.videoShareModal.show(this.currentTime) 214 this.videoShareModal.show(this.currentTime)
211 } 215 }
212 216
@@ -227,6 +231,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
227 } 231 }
228 } 232 }
229 233
234 onModalOpened () {
235 this.pausePlayer()
236 }
237
230 onVideoRemoved () { 238 onVideoRemoved () {
231 this.redirectService.redirectToHomepage() 239 this.redirectService.redirectToHomepage()
232 } 240 }
@@ -622,4 +630,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
622 ] 630 ]
623 if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys) 631 if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys)
624 } 632 }
633
634 private pausePlayer () {
635 if (!this.player) return
636
637 this.player.pause()
638 }
625} 639}