Display the preview image on waiting lives
This commit is contained in:
parent
0a6817f0ba
commit
c15d61f5fe
|
@ -7,7 +7,9 @@
|
||||||
Please try again later.
|
Please try again later.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="videojs-wrapper"></div>
|
<div id="videojs-wrapper">
|
||||||
|
<img *ngIf="playerPlaceholderImgSrc" [src]="playerPlaceholderImgSrc" alt="Placeholder image" i18n-alt>
|
||||||
|
</div>
|
||||||
|
|
||||||
<my-video-watch-playlist
|
<my-video-watch-playlist
|
||||||
#videoWatchPlaylist
|
#videoWatchPlaylist
|
||||||
|
|
|
@ -60,9 +60,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
player: any
|
player: any
|
||||||
playerElement: HTMLVideoElement
|
playerElement: HTMLVideoElement
|
||||||
|
|
||||||
theaterEnabled = false
|
theaterEnabled = false
|
||||||
|
|
||||||
userRating: UserVideoRateType = null
|
userRating: UserVideoRateType = null
|
||||||
descriptionLoading = false
|
|
||||||
|
playerPlaceholderImgSrc: string
|
||||||
|
|
||||||
video: VideoDetails = null
|
video: VideoDetails = null
|
||||||
videoCaptions: VideoCaption[] = []
|
videoCaptions: VideoCaption[] = []
|
||||||
|
@ -70,13 +73,17 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
playlistPosition: number
|
playlistPosition: number
|
||||||
playlist: VideoPlaylist = null
|
playlist: VideoPlaylist = null
|
||||||
|
|
||||||
|
descriptionLoading = false
|
||||||
completeDescriptionShown = false
|
completeDescriptionShown = false
|
||||||
completeVideoDescription: string
|
completeVideoDescription: string
|
||||||
shortVideoDescription: string
|
shortVideoDescription: string
|
||||||
videoHTMLDescription = ''
|
videoHTMLDescription = ''
|
||||||
|
|
||||||
likesBarTooltipText = ''
|
likesBarTooltipText = ''
|
||||||
|
|
||||||
hasAlreadyAcceptedPrivacyConcern = false
|
hasAlreadyAcceptedPrivacyConcern = false
|
||||||
remoteServerDown = false
|
remoteServerDown = false
|
||||||
|
|
||||||
hotkeys: Hotkey[] = []
|
hotkeys: Hotkey[] = []
|
||||||
|
|
||||||
tooltipLike = ''
|
tooltipLike = ''
|
||||||
|
@ -539,6 +546,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
this.videoCaptions = videoCaptions
|
this.videoCaptions = videoCaptions
|
||||||
|
|
||||||
// Re init attributes
|
// Re init attributes
|
||||||
|
this.playerPlaceholderImgSrc = undefined
|
||||||
this.descriptionLoading = false
|
this.descriptionLoading = false
|
||||||
this.completeDescriptionShown = false
|
this.completeDescriptionShown = false
|
||||||
this.completeVideoDescription = undefined
|
this.completeVideoDescription = undefined
|
||||||
|
@ -566,12 +574,15 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async buildPlayer (urlOptions: URLOptions) {
|
private async buildPlayer (urlOptions: URLOptions) {
|
||||||
const videoState = this.video.state.id
|
|
||||||
if (videoState === VideoState.LIVE_ENDED || videoState === VideoState.WAITING_FOR_LIVE) return
|
|
||||||
|
|
||||||
// Flush old player if needed
|
// Flush old player if needed
|
||||||
this.flushPlayer()
|
this.flushPlayer()
|
||||||
|
|
||||||
|
const videoState = this.video.state.id
|
||||||
|
if (videoState === VideoState.LIVE_ENDED || videoState === VideoState.WAITING_FOR_LIVE) {
|
||||||
|
this.playerPlaceholderImgSrc = this.video.previewPath
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Build video element, because videojs removes it on dispose
|
// Build video element, because videojs removes it on dispose
|
||||||
const playerElementWrapper = this.elementRef.nativeElement.querySelector('#videojs-wrapper')
|
const playerElementWrapper = this.elementRef.nativeElement.querySelector('#videojs-wrapper')
|
||||||
this.playerElement = document.createElement('video')
|
this.playerElement = document.createElement('video')
|
||||||
|
|
Loading…
Reference in New Issue