提问人:Dipesh Ranjan 提问时间:9/16/2023 更新时间:9/16/2023 访问量:60
在下一个 js src 目录中找不到视频的路径
Unable to find path for video, in next js src Directory
问:
我尝试通过各种方法导入视频,但它不断出现错误,我无法嵌入视频。
这是 app/page.tsx 的文件
import {videoBg} from '../assets/video/videoBg.mp4'
export default function Home() {
return (
<>
<main className='min-h-screen'>
<video
muted
loop
autoPlay
className="fixed -top-2 left-0 min-w-full min-h-full -z-50 object-cover"
>
<source src={videoBg} type="video/mp4" />
<source src={videoBg} type="video/ogg" />
Your browser does not support the video tag.
</video>
</main>
</>
)
}
目录结构如下
答: 暂无答案
评论
import {videoBg} from 'assets/video/videoBg.mp4'
assets
import {videoBg} from 'base/directory/assets/video/videoBg.mp4'
assets
baseUrl
paths
jsconfig.json
import videoBg from 'assets/video/videoBg.mp4'