In react i would do something like that:
type Props = {
url: string;
}
export const Video: React.FC<Props> = ({url}) => {
return (
<video
id="background-video"
loop
autoPlay
muted
style={{
position: "relative",
width: "100%",
height: "15rem",
left: 0,
top: 0,
}}
>
<source src={url} type="video/mp4" />
Your browser does not support the video tag.
</video>
);
};
but how should i do it in next.js like force it to wait and get video in browser?