【发布时间】:2020-06-16 12:19:34
【问题描述】:
在反应中我会做这样的事情:
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>
);
};
但是我应该如何在 next.js 中执行它,比如强制它等待并在浏览器中获取视频?
【问题讨论】: