mirror of https://github.com/Chocobozzz/PeerTube
Resume video playback on close of support modal (#3052)
* Resume video playback on close of support modal #2995 * Fix lint issuespull/3058/head
parent
17384fd856
commit
203d594f2d
|
@ -21,9 +21,11 @@ export class VideoSupportComponent {
|
|||
) { }
|
||||
|
||||
show () {
|
||||
this.modalService.open(this.modal, { centered: true })
|
||||
const modalRef = this.modalService.open(this.modal, { centered: true })
|
||||
|
||||
this.markdownService.enhancedMarkdownToHTML(this.video.support)
|
||||
.then(r => this.videoHTMLSupport = r)
|
||||
|
||||
return modalRef
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue