I'm passing a reference to the video element into my javascript function but am getting the following error. What syntax should I use here?
HTML
<video
v-for="option in visualizerOptions"
v-bind:key = "option.id"
src="@/assets/testvideo.mp4"
spinner-color="black"
class="carousel__item"
v-on:click="playVid(this)"
/>
Javascript
playVid(this) {
this.play()
}
Uncaught TypeError: this.play is not a function
Aha! I figured out the syntax on my own. Hopefully this helps others as I haven't seen this re-posted anywhere in my research.
The correct syntax to use here is ele.target.play()
playVid(ele) {
ele.target.play()
}