}
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 () {
this.pausePlayer()
- this.videoShareModal.show(this.currentTime)
+ this.videoShareModal.show(this.currentTime, this.videoWatchPlaylist.currentPlaylistPosition)
}
isUserLoggedIn () {
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