diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-20 09:57:00 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-20 10:00:07 +0100 |
commit | 0826c92d6fd327f9abcdda1054808a6b2587848d (patch) | |
tree | 5eec86ae81cfceb779aefa45453572cb3dd357c7 /client/src/app/videos | |
parent | 86f278cb4c582d487959b532b570b1a59f1fe5d2 (diff) | |
download | PeerTube-0826c92d6fd327f9abcdda1054808a6b2587848d.tar.gz PeerTube-0826c92d6fd327f9abcdda1054808a6b2587848d.tar.zst PeerTube-0826c92d6fd327f9abcdda1054808a6b2587848d.zip |
Add poster for video watch
Diffstat (limited to 'client/src/app/videos')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 3b5edc27a..5e2683334 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -33,7 +33,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
33 | error = false | 33 | error = false |
34 | loading = false | 34 | loading = false |
35 | player: videojs.Player | 35 | player: videojs.Player |
36 | playerElement: HTMLMediaElement | 36 | playerElement: HTMLVideoElement |
37 | userRating: UserVideoRateType = null | 37 | userRating: UserVideoRateType = null |
38 | video: VideoDetails = null | 38 | video: VideoDetails = null |
39 | videoPlayerLoaded = false | 39 | videoPlayerLoaded = false |
@@ -288,6 +288,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
288 | if (this.videoPlayerLoaded !== true) { | 288 | if (this.videoPlayerLoaded !== true) { |
289 | this.playerElement = this.elementRef.nativeElement.querySelector('#video-element') | 289 | this.playerElement = this.elementRef.nativeElement.querySelector('#video-element') |
290 | 290 | ||
291 | // If autoplay is true, we don't really need a poster | ||
292 | if (this.isAutoplay() === false) { | ||
293 | console.log('coucou') | ||
294 | this.playerElement.poster = this.video.previewUrl | ||
295 | } | ||
296 | |||
291 | const videojsOptions = { | 297 | const videojsOptions = { |
292 | controls: true, | 298 | controls: true, |
293 | autoplay: this.isAutoplay(), | 299 | autoplay: this.isAutoplay(), |