}
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)
}
return this.authService.isLoggedIn()
}
+ getVideoUrl () {
+ if (!this.video.url) {
+ return this.video.originInstanceUrl + VideoDetails.buildClientUrl(this.video.uuid)
+ }
+ return this.video.url
+ }
+
getVideoTags () {
if (!this.video || Array.isArray(this.video.tags) === false) return []
}
}
- onModalOpened () {
- this.pausePlayer()
- }
-
onVideoRemoved () {
this.redirectService.redirectToHomepage()
}
this.setOpenGraphTags()
this.checkUserRating()
- this.hooks.runAction('action:video-watch.video.loaded', 'video-watch', { videojs })
+ const hookOptions = {
+ videojs,
+ video: this.video,
+ playlist: this.playlist
+ }
+ this.hooks.runAction('action:video-watch.video.loaded', 'video-watch', hookOptions)
}
private async buildPlayer (urlOptions: URLOptions) {
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()