mirror of
https://github.com/kevin-DL/vue-audio-recorder.git
synced 2026-01-11 10:54:26 +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 |
|
||||
| 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-custom-button | Boolean | If true show another button linked to specific action. Default: true |
|
||||
| before-upload | Function | Callback fires before uploading |
|
||||
| successful-upload | Function | Callback fires after successful 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 |
|
||||
| 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 |
|
||||
| custom-callback | Function | Callback fires when clicking on the custom button |
|
||||
|
||||
## AudioPlayer props
|
||||
| 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"
|
||||
:headers="headers"
|
||||
:upload-url="uploadUrl"/>
|
||||
<button v-if="showCustomButton" @click="customAction(record)"> Custom Action </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -265,6 +266,7 @@
|
||||
|
||||
showDownloadButton : { type: Boolean, default: true },
|
||||
showUploadButton : { type: Boolean, default: true },
|
||||
showCustomButton : {type: Boolean, default: false},
|
||||
|
||||
micFailed : { type: Function },
|
||||
beforeRecording : { type: Function },
|
||||
@@ -274,7 +276,8 @@
|
||||
beforeUpload : { type: Function },
|
||||
successfulUpload : { type: Function },
|
||||
selectRecord : { type: Function },
|
||||
format : { type: String }
|
||||
customCallback : { type: Function },
|
||||
format : { type: String }
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -352,6 +355,13 @@
|
||||
sampleRate : this.sampleRate,
|
||||
format : this.format
|
||||
})
|
||||
},
|
||||
customAction(record) {
|
||||
if (this.customCallback) {
|
||||
this.customCallback(record)
|
||||
} else {
|
||||
console.log(record)
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
Reference in New Issue
Block a user