Skip to content

Commit 12983cd

Browse files
committed
fix: check elements before video instantiation
1 parent def31b3 commit 12983cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Video/Video.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ export interface VideoProps extends InputProps {
2121

2222
export const Video: FC<VideoProps> = ({ label, testId }) => {
2323
useEffect(() => {
24-
new VideoPlayer(document.querySelector('video'));
24+
const el = document.querySelector('video');
25+
if (el) {
26+
new VideoPlayer(el);
27+
}
2528
});
2629
return (
2730
<div className="row" data-testid={testId}>

0 commit comments

Comments
 (0)