|
@@ -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()
|