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