Add poster for video watch
This commit is contained in:
parent
86f278cb4c
commit
0826c92d6f
1 changed files with 7 additions and 1 deletions
|
@ -33,7 +33,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
error = false
|
error = false
|
||||||
loading = false
|
loading = false
|
||||||
player: videojs.Player
|
player: videojs.Player
|
||||||
playerElement: HTMLMediaElement
|
playerElement: HTMLVideoElement
|
||||||
userRating: UserVideoRateType = null
|
userRating: UserVideoRateType = null
|
||||||
video: VideoDetails = null
|
video: VideoDetails = null
|
||||||
videoPlayerLoaded = false
|
videoPlayerLoaded = false
|
||||||
|
@ -288,6 +288,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
if (this.videoPlayerLoaded !== true) {
|
if (this.videoPlayerLoaded !== true) {
|
||||||
this.playerElement = this.elementRef.nativeElement.querySelector('#video-element')
|
this.playerElement = this.elementRef.nativeElement.querySelector('#video-element')
|
||||||
|
|
||||||
|
// If autoplay is true, we don't really need a poster
|
||||||
|
if (this.isAutoplay() === false) {
|
||||||
|
console.log('coucou')
|
||||||
|
this.playerElement.poster = this.video.previewUrl
|
||||||
|
}
|
||||||
|
|
||||||
const videojsOptions = {
|
const videojsOptions = {
|
||||||
controls: true,
|
controls: true,
|
||||||
autoplay: this.isAutoplay(),
|
autoplay: this.isAutoplay(),
|
||||||
|
|
Loading…
Reference in a new issue