ActivityPub-federated video streaming platform using P2P directly in your web browser
Display the preview image on waiting lives
Chocobozzzc15d61f5fee4
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.html b/client/src/app/+videos/+video-watch/video-watch.component.htmlindex 669fede439..b17f898ce7 100644--- a/client/src/app/+videos/+video-watch/video-watch.component.html+++ b/client/src/app/+videos/+video-watch/video-watch.component.html@@ -7,7 +7,9 @@Please try again later.</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#videoWatchPlaylistdiff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.tsindex 11b63297e6..7a98cab3b0 100644--- a/client/src/app/+videos/+video-watch/video-watch.component.ts+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts@@ -60,9 +60,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {player: anyplayerElement: HTMLVideoElement+theaterEnabled = false+userRating: UserVideoRateType = null- descriptionLoading = false++ playerPlaceholderImgSrc: stringvideo: VideoDetails = nullvideoCaptions: VideoCaption[] = []@@ -70,13 +73,17 @@ export class VideoWatchComponent implements OnInit, OnDestroy {playlistPosition: numberplaylist: VideoPlaylist = null+ descriptionLoading = falsecompleteDescriptionShown = falsecompleteVideoDescription: stringshortVideoDescription: stringvideoHTMLDescription = ''+likesBarTooltipText = ''+hasAlreadyAcceptedPrivacyConcern = falseremoteServerDown = false+hotkeys: Hotkey[] = []tooltipLike = ''@@ -539,6 +546,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {this.videoCaptions = videoCaptions// Re init attributes+ this.playerPlaceholderImgSrc = undefinedthis.descriptionLoading = falsethis.completeDescriptionShown = falsethis.completeVideoDescription = undefined@@ -566,12 +574,15 @@ export class VideoWatchComponent implements OnInit, OnDestroy {}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 neededthis.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 disposeconst playerElementWrapper = this.elementRef.nativeElement.querySelector('#videojs-wrapper')this.playerElement = document.createElement('video')