Answer the question
In order to leave comments, you need to log in
Why doesn't audioTrack.pause() work in vuejs?
Wrote this code:
methods: {
startAudio (audio) {
let audioTrack = new Audio(audio)
if (this.isTargeted === false) {
audioTrack.play()
this.isTargeted = true
} else {
audioTrack.pause()
audioTrack.currentTime = 0
this.isTargeted = false
}
}
}
v-on:click="startAudio( attachment.audio.audio )"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question