일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- jQuery EventListener
- scanner bufferedreader
- js canvas
- request property
- SWEA 1228 python
- ReactMediaRecorder
- $.ajax 사용
- Canvas
- sw8931
- web recorder
- 페이지 내 탭
- MySQL
- js session
- java
- SWEA 11315 python
- 탭 활용해 내용바꾸기
- scroll 맨 밑
- tabs switch
- GitHub
- CSS
- javascript
- js 객체생성
- SWEA 6190 python
- response property
- Git
- MySQL update delete
- SWEA 1954 java
- js XML 읽기
- dispatcherservlet 오류
- scroll 맨 밑 이동
Archives
- Today
- Total
Daily Pogle
[React] Record API : ReactMediaRecorder 본문
react-media-recorder
A React component based on MediaRecorder() API to record audio/video streams. Latest version: 1.6.6, last published: a year ago. Start using react-media-recorder in your project by running `npm i react-media-recorder`. There are 17 other projects in the np
www.npmjs.com
웹페이지에서 recorder 를 사용하고 싶을 때 사용할 수 있는 API
npm 설치
npm install react-media-recorder
실제사용
- status | 현재 recorder 의 상태를 보여줌
- startRecording (function) | 녹화시작함수
- stopRecording (function) | 녹화중단(종료)함수
- mediaBlobUrl | 녹화한 영상이나 음성을 나타내는 Blob 객체 생성(녹화종료시 생성됨) / a, audio, video 태그의 href 속성에 사용됨.
* Blob (Blnary Large Object) : 멀티미디어 데이터를 다룰 때 사용하는 객체로 불변하는 raw data
function App() {
return (
<div>
<ReactMediaRecorder
audio
render={({ status, startRecording, stopRecording, mediaBlobUrl }) =>(
<div>
<p>{status}</p>
<button onClick={startRecording}>start recording</button>
<button onClick={stopRecording}>stop recording</button><br/><br/>
<audio src={mediaBlobUrl} controls></audio><br/>
<a href={mediaBlobUrl} download="mysound.wav">download</a>
</div>
)}
/>
</div>
}
'프론트엔드 기술 > React' 카테고리의 다른 글
[React] Styled Components (1) | 2023.11.01 |
---|---|
[React] Router 설정 및 페이지 이동 (0) | 2023.03.28 |
[React] useEffect (0) | 2023.03.28 |
[React] useState (0) | 2023.03.27 |
[React] JSX (0) | 2023.03.07 |