Correctly load live information when not started

pull/3770/head
Chocobozzz 2021-02-22 10:46:52 +01:00
parent 70243d7a35
commit 0a6817f0ba
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 14 additions and 9 deletions

View File

@ -553,6 +553,19 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
if (res === false) return this.location.back()
}
this.buildPlayer(urlOptions)
.catch(err => console.error('Cannot build the player', err))
this.setVideoDescriptionHTML()
this.setVideoLikesBarTooltipText()
this.setOpenGraphTags()
this.checkUserRating()
this.hooks.runAction('action:video-watch.video.loaded', 'video-watch', { videojs })
}
private async buildPlayer (urlOptions: URLOptions) {
const videoState = this.video.state.id
if (videoState === VideoState.LIVE_ENDED || videoState === VideoState.WAITING_FOR_LIVE) return
@ -568,7 +581,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
const params = {
video: this.video,
videoCaptions,
videoCaptions: this.videoCaptions,
urlOptions,
user: this.user
}
@ -642,14 +655,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
this.hooks.runAction('action:video-watch.player.loaded', 'video-watch', { player: this.player, videojs, video: this.video })
})
this.setVideoDescriptionHTML()
this.setVideoLikesBarTooltipText()
this.setOpenGraphTags()
this.checkUserRating()
this.hooks.runAction('action:video-watch.video.loaded', 'video-watch', { videojs })
}
private autoplayNext () {