forked from rocicorp/zero-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideo.tsx
More file actions
31 lines (26 loc) · 644 Bytes
/
Video.tsx
File metadata and controls
31 lines (26 loc) · 644 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use client';
import React from 'react';
type VideoProps = {
src: string; // Path to the video file
alt: string; // Accessibility text
};
const Video: React.FC<VideoProps> = ({src, alt}) => {
if (!src) {
console.error("Video component requires a 'src' property.");
return null;
}
return (
<div style={{maxWidth: '100%', margin: '1rem 0'}}>
<video
src={src}
controls
style={{width: '100%', borderRadius: '8px'}}
aria-label={alt}
>
<track kind="captions" />
Your browser does not support the video tag.
</video>
</div>
);
};
export default Video;