rg_
rg_

Reputation: 57

Autoplay function in embedded video vue.js?

Is it possible to autoplay the embedded video in the website? Tried different solutions to make it work on vue.js but it won't. Even adding autoplay=1 in the link, doesn't work. I'm using the iframe code from youtube, which I will provide below.

<iframe width="1060" height="615" src="[Link]?autoplay=1controls=0" title="Youtube Video" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Upvotes: 0

Views: 4336

Answers (1)

Jan Kees
Jan Kees

Reputation: 195

Autoplay with youtube iframe (embedded) only works if you mute the sound!

so

<iframe width="1060" height="615" src="https://www.youtube.com/embed/L_gGKD8UNKA?autoplay=1&mute=1" title="Youtube Video" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

by adding mute=1 after autoplay=1 it starts the video automatically

here is a codepen.io link!

Upvotes: 1

Related Questions