Update readme

This commit is contained in:
Gennady Grishkovtsov
2018-08-09 22:15:18 +03:00
parent 6f7a99c506
commit a573538bac

View File

@@ -1,6 +1,6 @@
# vue-audio-recorder
> Audio recorder for Vue.js. It allows to create, play, download and store records on a server
> Audio recorder for Vue.js. It allows to create, play, download and store records on a server.
#### [Live demo](https://jsfiddle.net/grishkovelli/rb1anxyj/)
@@ -13,6 +13,7 @@
- Time limit
- Records limit
- A lot of callbacks
- Individual an audio player
### Tested in
@@ -26,26 +27,49 @@
npm i vue-audio-recorder --save
```
## Props
## AudioRecorder props
| Prop | Type | Description |
| --------------------- | -------- | ---------------------------------------------------------------- |
| --------------------- | -------- | --------------------------------------------------------------- |
| attempts | Number | Number of recording attempts |
| time | Number | Time limit for record in minutes |
| compact | Boolean | Hide the download and upload buttons |
| time | Number | Time limit for the record (minutes) |
| upload-url | String | URL for uploading |
| start-record | Function | It fires after click the record button |
| stop-record | Function | It fires after click the stop button or exceeding the time limit |
| start-upload | Function | It fires after start uploading |
| attempts-limit | Function | It fires after exceeding the attempts |
| failed-upload | Function | Is fires after failure uploading |
| mic-failed | Function | It fires if your microphone doesn't work |
| successful-upload | Function | It fires after successful uploading |
| successful-upload-msg | String | Display the message after successful uploading |
| failed-upload-msg | String | Display the message after failure uploading |
| start-record | Function | Fires after click the record button |
| stop-record | Function | Fires after click the stop button or exceeding the time limit |
| start-upload | Function | Fires after start uploading |
| attempts-limit | Function | Fires after exceeding the attempts |
| failed-upload | Function | Fires after a failure uploading |
| mic-failed | Function | Fires if your microphone doesn't work |
| successful-upload | Function | Fires after a successful uploading |
| successful-upload-msg | String | Displays the message after a successful uploading |
| failed-upload-msg | String | Displays the message after a failure uploading |
## AudioPlayer props
| Prop | Type | Description |
| --------------------- | -------- | --------------------------------------------------------------- |
| src | String | Specifies the URL of the audio file |
## Usage
The most common use case is to register the component globally
```js
import {AudioRecorder, AudioPlayer} from 'vue-audio-recorder'
Vue.component(AudioPlayer)
Vue.component(AudioRecorder)
```
Alternatively you can do this to register the components
```js
import AudioRecorder from 'vue-audio-recorder'
Vue.use(AudioRecorder)
```
```html
<audio-recorder
upload-url="YOUR_API_URL"
:attempts="3"
@@ -57,6 +81,10 @@ npm i vue-audio-recorder --save
:failed-upload="callback"/>
```
```html
<audio-player src="/demo/example.mp3"/>
```
## Build Setup
``` bash