Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 디자인토큰
- 데이터분석
- 리액트
- 프론트엔드
- 한글자동화
- 디자인
- 디자인 토큰
- SaaS디자인
- 3d
- 문서자동화
- 플랫폼
- angular
- blender
- three.js
- UI
- CINEMA4D
- frontend
- sass
- 웹디자인
- 업무자동화
- design token
- 파이썬
- chatGPT
- 에러노트
- 생성AI
- Airtable
- scss
- UX
- 에어테이블
- CSS
Archives
- Today
- Total
이게 무슨 일이야!
typescript 에서 video 붙일 때 에러 해결하기! 본문
react typescirpt 에 평범한 방법으로 비디오를 붙였을 뿐인데 TS2307: Cannot find module '../assets/videos/sample.mp4' or its corresponding type declarations. 이런 에러 났을 때 참조
1. 비디오를 assets/videos 폴더 안에 넣는다
2. tsconfig.json 중괄호 안에 "typeRoots": ["videos "] 를 추가
{
"compilerOptions" : ...
"typeRoots":["videos"]
}
3. assets/videos 폴더 안에 videos.d.ts 파일을 넣는다 (파일 안에는 동영상 확장자의 타입 선언)
declare module '*.mov';
declare module '*.mp4';
4. 페이지에 일반적인 소스 적용
muted 걸어야 동영상 autoPlay 가능함 (브라우저 정책 때문)
<video height="600" width="400" muted autoPlay loop controls>
<source src="/assets/videos/sample.mp4" type="video/mp4"></source>
</video>
참조
tsx에 이미지 추가할 때 오류 해결 방법 [TypeScript]
js 에서 tsx 확장자 명을 바꾸고 나니 아래의 메시지와 함께 빨간불이 떳습니다.TS2307: Cannot find module '../assets/icons/flag-pink.png' or its corresponding type declarations.해결 방법으
velog.io
swiper 배너에 비디오 넣기
https://codepen.io/intotheprogram/pen/qBRmRKj
Swiper|Play Pause Video
...
codepen.io
'프론트엔드 개발 > React' 카테고리의 다른 글
aes256 암복호화 java 인코딩 -> javascript 디코딩 (0) | 2023.01.02 |
---|---|
리액트에서 스크롤 위치별 애니메이션 줄때 참고 (0) | 2022.12.19 |
quill text editor 로 등록한 글 뷰어 스타일 깨짐 수정 (0) | 2022.12.14 |
port 가 다른 두 React SPA 사이에서 localStorage, cookie 공유하기 (0) | 2022.11.21 |
React 에서 무한 스크롤 구현 (0) | 2022.11.01 |
Comments