Closed supakornkim closed 4 years ago
Hi, you can use refs to access the component and then call the exposed methods such as: start, stop, pause, resume
Unfortunately are still undocumented right now but you can see them in the source code
Hello,
I try .. but error <VueRecordAudio ref="voicerecord" @result="onResult" :mode="recMode" /> this.$refs.voicerecord.start() VM4033:37 [Vue warn]: Error in v-on handler: "TypeError: this.$refs.voicerecord.start is not a function"
but I use this and it works <VueRecordAudio id="voicerecord" @result="onResult" :mode="recMode" /> document.getElementById('voicerecord').dispatchEvent(new Event('mouseup'))
Hi, this is really strange because the methods are defined, checkout this screenshot:
<vue-record-audio ref="Recorder" />
export default {
mounted() {
console.log(this.$refs.Recorder.start)
}
}
Probably is something else in your code, If you copy n paste an extract of it, I try to help
Hello, ok. it is work now.
It does not work because I have multiple of
Thank you so much
It does not work because I have multiple of components. So, when I make it to have only 1 component, start() and stop() now work!
multiple vue-record components? if so, it sound like a bug to me, maybe I should check.. can you paste some of the code, i'm a little bit curious
Hello,
Is there a way to trigger to recording audio from JS code without pressing button by user?
Thank you.