<div class="row">
<!-- We need the video container for videojs so we just hide it -->
<div [hidden]="videoNotFound" id="video-container">
- <video [poster]="getVideoPoster()" id="video-element" class="video-js vjs-peertube-skin"></video>
+ <video id="video-element" class="video-js vjs-peertube-skin"></video>
</div>
<div *ngIf="videoNotFound" id="video-not-found">Video not found :'(</div>
if (this.videoPlayerLoaded !== true) {
this.playerElement = this.elementRef.nativeElement.querySelector('#video-element')
- // If autoplay is true, we don't really need a poster
- if (this.isAutoplay() === false) {
- this.playerElement.poster = this.video.previewUrl
- }
-
const videojsOptions = getVideojsOptions({
autoplay: this.isAutoplay(),
inactivityTimeout: 4000,
videoViewUrl: this.videoService.getVideoViewUrl(this.video.uuid),
videoDuration: this.video.duration,
enableHotkeys: true,
- peertubeLink: false
+ peertubeLink: false,
+ poster: this.video.previewUrl
})
this.videoPlayerLoaded = true
videoFiles: VideoFile[],
enableHotkeys: boolean,
inactivityTimeout: number,
- peertubeLink: boolean
+ peertubeLink: boolean,
+ poster: string
}) {
const videojsOptions = {
controls: true,
+ poster: options.poster,
autoplay: options.autoplay,
inactivityTimeout: options.inactivityTimeout,
playbackRates: [ 0.5, 1, 1.5, 2 ],
this.alterInactivity()
if (this.autoplay === true) {
+ this.player.posterImage.hide()
this.updateVideoFile(undefined, () => this.player.play())
} else {
// Proxify first play
outline: 0;
font-size: 6em;
- $big-play-width: 1.5em;
- $big-play-height: 1em;
+ $big-play-width: 1.2em;
+ $big-play-height: 1.2em;
border: 0;
- border-radius: 0.3em;
+ border-radius: 100%;
left: 50%;
top: 50%;
}
.vjs-icon-placeholder::before {
- transition: text-shadow 0.3s;
+ transition: font-size 0.5s, opacity 0.5s;
}
&:hover {
- opacity: 0.9;
+ opacity: 0.8;
.vjs-icon-placeholder::before {
- text-shadow: 0 0 1px rgba(255, 255, 255, 0.8);
+ font-size: 110%;
}
}
}
&.vjs-has-started .vjs-big-play-button {
display: block;
visibility: hidden;
- opacity: 0;
- transition: visibility 0.3s, opacity 0.3s;
+
+ &, &::before {
+ opacity: 0;
+ transition: visibility 0.1s, opacity 0.1s;
+ }
+ }
+
+ &.vjs-has-started video {
+ background-color: #000;
+ animation: fade-black-on-play 0.5s linear;
+
+ @keyframes fade-black-on-play {
+ 0% {
+ opacity: 1;
+ }
+ 50% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+ }
}
.vjs-control-bar,
.vjs-menu-item {
+ &:hover {
+ background-color: rgba(255, 255, 255, 0.2);
+ }
+
&:first-child {
margin-top: 5px;
}
html, body {
height: 100%;
margin: 0;
+ background-color: #000;
}
.video-js.vjs-peertube-skin {
const videoContainerId = 'video-container'
const videoElement = document.getElementById(videoContainerId) as HTMLVideoElement
- videoElement.poster = window.location.origin + videoInfo.previewPath
-
let autoplay = false
try {
videoFiles: videoInfo.files,
videoDuration: videoInfo.duration,
enableHotkeys: true,
- peertubeLink: true
+ peertubeLink: true,
+ poster: window.location.origin + videoInfo.previewPath
})
videojs(videoContainerId, videojsOptions, function () {
const player = this