You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-2
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,14 @@ An audio recording helper for React. Provides a component and a hook to help wit
7
7
npm install react-audio-voice-recorder
8
8
```
9
9
10
+
```sh
11
+
yarn add react-audio-voice-recorder
12
+
```
13
+
14
+
## Migrating from v1 → v2
15
+
### Breaking changes
16
+
- In v2 the `AudioRecorder` prop `downloadFileExtension` no longer supports `mp3` and `wav` without the website using this package being [cross-origin isolated](https://web.dev/cross-origin-isolation-guide/). This change was made in order to fix [issue #54](https://github.com/samhirtarif/react-audio-recorder/issues/54) in v1.2.1
| **`audioTrackConstraints`** | Takes a [subset](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings#instance_properties_of_audio_tracks) of `MediaTrackConstraints` that apply to the audio track | N/A | Yes
48
56
| **`onNotAllowedOrFound`** | This gets called when the `getUserMedia` promise is rejected. It takes the resultant `DOMException` as its parameter | N/A | Yes
49
57
|**`downloadOnSavePress`**| A `boolean` value that determines if the recording should be downloaded when "Save recording" option is pressed |`false`| Yes |
50
-
|**`downloadFileExtension`**| The file extension to be used for the downloaded file. Allowed values are `mp3`, `wav` and `webm`|`mp3`| Yes |
58
+
|**`downloadFileExtension`**| The file extension to be used for the downloaded file. Allowed values are `webm`, `mp3` and `wav`. In order to use `mp3` or `wav` please ensure that your website is [cross-origin isolated](https://web.dev/cross-origin-isolation-guide/). [Further reading](https://web.dev/coop-coep/)|`webm`| Yes |
51
59
|**`showVisualizer`**| Displays a waveform visualization for the audio when set to `true`|`false`| Yes |
52
60
|**`classes`**| This allows class names to be passed to modify the styles for the entire component or specific portions of it | N/A | Yes |
61
+
62
+
**NOTE: In order for `mp3` and `wav` downloading to work properly, your website needs to be [cross-origin isolated](https://web.dev/cross-origin-isolation-guide/). This is necessary because this package uses [FFmpeg](https://www.npmjs.com/package/@ffmpeg/ffmpeg) which internally uses `SharedArrayBuffer` that requires cross-origin isolation**
0 commit comments