Is there a way to play a video element inside an iframe? The iframe is automatically generating the video element and controls. Many suggestions mention adding &autoplay
to the src
, but this is not a YouTube iframe.
This is my HTML code:
<button @click="playVideo(item.name)">play</button>
<iframe :ref="item.name" autoplay :src="item.video_link" :title='item.name'></iframe>
Javascript:
playVideo(itemName) {
this.$refs[itemName] <--- This gives me the iframe DOM element I want to play
},
Rendered image: