mirror of
https://github.com/kevin-DL/vue-audio-recorder.git
synced 2026-01-11 19:04:28 +00:00
Trying to add a button with a custom function
This commit is contained in:
@@ -42,6 +42,7 @@ npm i vue-audio-recorder --save
|
|||||||
| upload-url | String | URL for uploading |
|
| upload-url | String | URL for uploading |
|
||||||
| show-download-button | Boolean | If it is true show a download button. Default: true |
|
| show-download-button | Boolean | If it is true show a download button. Default: true |
|
||||||
| show-upload-button | Boolean | If it is true show an upload button. Default: true |
|
| show-upload-button | Boolean | If it is true show an upload button. Default: true |
|
||||||
|
| show-custom-button | Boolean | If true show another button linked to specific action. Default: true |
|
||||||
| before-upload | Function | Callback fires before uploading |
|
| before-upload | Function | Callback fires before uploading |
|
||||||
| successful-upload | Function | Callback fires after successful uploading |
|
| successful-upload | Function | Callback fires after successful uploading |
|
||||||
| failed-upload | Function | Callback fires after failure uploading |
|
| failed-upload | Function | Callback fires after failure uploading |
|
||||||
@@ -50,6 +51,7 @@ npm i vue-audio-recorder --save
|
|||||||
| pause-recording | Function | Callback fires after pause recording |
|
| pause-recording | Function | Callback fires after pause recording |
|
||||||
| after-recording | Function | Callback fires after click the stop button or exceeding the time limit |
|
| after-recording | Function | Callback fires after click the stop button or exceeding the time limit |
|
||||||
| select-record | Function | Callback fires after choise a record. Returns the record |
|
| select-record | Function | Callback fires after choise a record. Returns the record |
|
||||||
|
| custom-callback | Function | Callback fires when clicking on the custom button |
|
||||||
|
|
||||||
## AudioPlayer props
|
## AudioPlayer props
|
||||||
| Prop | Type | Description |
|
| Prop | Type | Description |
|
||||||
|
|||||||
2
dist/vue-audio-recorder.min.js
vendored
2
dist/vue-audio-recorder.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/vue-audio-recorder.min.js.map
vendored
2
dist/vue-audio-recorder.min.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -237,6 +237,7 @@
|
|||||||
:filename="filename"
|
:filename="filename"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:upload-url="uploadUrl"/>
|
:upload-url="uploadUrl"/>
|
||||||
|
<button v-if="showCustomButton" @click="customAction(record)"> Custom Action </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -265,6 +266,7 @@
|
|||||||
|
|
||||||
showDownloadButton : { type: Boolean, default: true },
|
showDownloadButton : { type: Boolean, default: true },
|
||||||
showUploadButton : { type: Boolean, default: true },
|
showUploadButton : { type: Boolean, default: true },
|
||||||
|
showCustomButton : {type: Boolean, default: false},
|
||||||
|
|
||||||
micFailed : { type: Function },
|
micFailed : { type: Function },
|
||||||
beforeRecording : { type: Function },
|
beforeRecording : { type: Function },
|
||||||
@@ -274,6 +276,7 @@
|
|||||||
beforeUpload : { type: Function },
|
beforeUpload : { type: Function },
|
||||||
successfulUpload : { type: Function },
|
successfulUpload : { type: Function },
|
||||||
selectRecord : { type: Function },
|
selectRecord : { type: Function },
|
||||||
|
customCallback : { type: Function },
|
||||||
format : { type: String }
|
format : { type: String }
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
@@ -352,6 +355,13 @@
|
|||||||
sampleRate : this.sampleRate,
|
sampleRate : this.sampleRate,
|
||||||
format : this.format
|
format : this.format
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
customAction(record) {
|
||||||
|
if (this.customCallback) {
|
||||||
|
this.customCallback(record)
|
||||||
|
} else {
|
||||||
|
console.log(record)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
Reference in New Issue
Block a user