Skip to content

Commit 32f246c

Browse files
committed
fix: guard previewWidth to avoid emitting width="0" on video elements
1 parent e9c429c commit 32f246c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/react/src/blocks/Video/block.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const VideoPreview = (
2727
: resolved.downloadUrl
2828
}
2929
controls={true}
30-
width={props.block.props.previewWidth}
30+
width={props.block.props.previewWidth || undefined}
3131
contentEditable={false}
3232
draggable={false}
3333
/>
@@ -45,7 +45,7 @@ export const VideoToExternalHTML = (
4545
}
4646

4747
const video = props.block.props.showPreview ? (
48-
<video src={props.block.props.url} width={props.block.props.previewWidth} />
48+
<video src={props.block.props.url} width={props.block.props.previewWidth || undefined} />
4949
) : (
5050
<a href={props.block.props.url}>
5151
{props.block.props.name || props.block.props.url}

0 commit comments

Comments
 (0)