Skip to content

Commit 3fcc158

Browse files
committed
Fix height for videos
1 parent 1686380 commit 3fcc158

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

video/src/Video.module.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
overflow: hidden;
66
}
77

8+
.section {
9+
position: absolute;
10+
inset: 0 0 0 0;
11+
}
12+
813
.video {
914
outline: none;
1015
width: 100%;

video/src/Video.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type Props = {
2222
url: string;
2323
};
2424
preload: 'auto' | 'metadata' | 'none';
25+
section?: boolean;
2526
};
2627

2728
const Video = ({
@@ -34,6 +35,7 @@ const Video = ({
3435
loop,
3536
disableTracking,
3637
autoplay = false,
38+
section = false,
3739
}: Props) => {
3840
const videoRef = useRef<HTMLVideoElement>();
3941
const stateRef = useRef<{ current: number; maxProgress: number }>({
@@ -184,9 +186,11 @@ const Video = ({
184186
let videoCl = styles.video;
185187
if (fill) videoCl += ' ' + styles.fill;
186188

189+
let cl = styles.wrapper;
190+
if (section) cl = styles.section;
187191

188192
return (
189-
<div className={styles.wrapper}>
193+
<div className={cl}>
190194
{!video && (
191195
<div className={styles.empty}>
192196
<h3>Double-click to select video</h3>

0 commit comments

Comments
 (0)