Browse Source

Make video poster fill player and not use the logo. For #1857

pull/2032/head
Gabe Kangas 4 years ago
parent
commit
3c43db4d86
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA
  1. 4
      web/components/video/OwncastPlayer.tsx
  2. 5
      web/components/video/Player.module.scss
  3. 2
      web/components/video/VideoPoster.module.scss
  4. 4
      web/components/video/VideoPoster.tsx

4
web/components/video/OwncastPlayer.tsx

@ -296,7 +296,9 @@ export default function OwncastPlayer(props: Props) { @@ -296,7 +296,9 @@ export default function OwncastPlayer(props: Props) {
</div>
)}
<div style={{ gridColumn: 1, gridRow: 1 }}>
{!videoPlaying && <VideoPoster online={online} initialSrc="/logo" src="/thumbnail.jpg" />}
{!videoPlaying && (
<VideoPoster online={online} initialSrc="/thumbnail.jpg" src="/thumbnail.jpg" />
)}
</div>
</div>
);

5
web/components/video/Player.module.scss

@ -2,3 +2,8 @@ @@ -2,3 +2,8 @@
height: 80vh;
width: 100%;
}
.poster {
width: 100%;
height: 100%;
}

2
web/components/video/VideoPoster.module.scss

@ -2,4 +2,6 @@ @@ -2,4 +2,6 @@
background-color: black;
display: flex;
justify-content: center;
width: 100%;
height: 100%;
}

4
web/components/video/VideoPoster.tsx

@ -30,7 +30,7 @@ export default function VideoPoster(props: Props) { @@ -30,7 +30,7 @@ export default function VideoPoster(props: Props) {
return (
<div className={s.poster}>
{!online && <img src={initialSrc} alt="logo" height="500vh" />}
{!online && <img src={initialSrc} alt="logo" />}
{online && (
<CrossfadeImage
@ -38,7 +38,7 @@ export default function VideoPoster(props: Props) { @@ -38,7 +38,7 @@ export default function VideoPoster(props: Props) {
duration={duration}
objectFit="contain"
width="100%"
height="500px"
height="100%"
/>
)}
</div>

Loading…
Cancel
Save