반응형
Next.js, Nextra에서 영상 파일을 사용하는 법
1. next-videos 설치
$ npm install next-videos
$ yarn add next-videos
$ pnpm add next-videos
2. next.config.js에 종속성 적용
// 다른 종속성 적용 부분
const nextConfig = {
...
}
const withVideos = require("next-videos");
module.exports = withVideos(nextConfig);
3. video 태그로 영상 파일 사용
<video
autoPlay={true}
muted={true}
loop={true}
style={{ width: "100%", height: "650px" }}
src={require("/public/영상파일.mp4")}
/>
1. autoPlay: 자동재생 여부
2. muted: 음소거
3. loop: 반복배생
4. style: 크기 조절
5. src: 영상파일 위치
반응형
'문서 정리 프레임워크 > Nextra' 카테고리의 다른 글
[Nextra] .gif 파일 unoptimized warning 해결 (0) | 2024.08.14 |
---|---|
[Nextra] index 없애기 (0) | 2024.08.13 |
[Nextra] existSync is not a function (0) | 2024.08.11 |
[Next.js, Nextra] @next/font 패키지 경고 해결 (0) | 2024.08.09 |
[Nextra] 마크다운 파일(.md) 테이블 사용(<table></table>) (0) | 2024.04.22 |
댓글