Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
grishkovelli committed Aug 9, 2018
1 parent 6f7a99c commit a573538
Showing 1 changed file with 45 additions and 17 deletions.
62 changes: 45 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/)

Expand All @@ -13,6 +13,7 @@
- Time limit
- Records limit
- A lot of callbacks
- Individual an audio player

### Tested in

Expand All @@ -26,26 +27,49 @@
npm i vue-audio-recorder --save
```

## Props

| Prop | Type | Description |
| --------------------- | -------- | ---------------------------------------------------------------- |
| attempts | Number | Number of recording attempts |
| time | Number | Time limit for record in 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 |
## AudioRecorder props

| Prop | Type | Description |
| --------------------- | -------- | --------------------------------------------------------------- |
| attempts | Number | Number of recording attempts |
| 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 | 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"
Expand All @@ -57,6 +81,10 @@ npm i vue-audio-recorder --save
:failed-upload="callback"/>
```

```html
<audio-player src="/demo/example.mp3"/>
```

## Build Setup

``` bash
Expand Down

0 comments on commit a573538

Please sign in to comment.