我想添加背景视频,格式为mp4,但NextJS显示错误:
./public/video/ocean.mp4 1:0
Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type, currently
no loaders are configured to process this file. See
https://webpack.js.org/concepts#loaders
Run Code Online (Sandbox Code Playgroud)
(此二进制文件省略源代码)
import React, {useEffect, useRef} from "react"
import Layout from "../components/webSite/layout";
import backgroundVideo from "../public/video/ocean.mp4"
const Home = () => {
const videoRef = useRef()
useEffect(() => {
setTimeout(()=>{
videoRef.current.play()
},5000)
}, []);
return <Layout title={"Home"}>
<video
ref={videoRef}
controls
width="250"
loop
muted
style={{
position: "relative",
width: "100%",
height: …Run Code Online (Sandbox Code Playgroud)