Home > Enterprise >  Autoplay function in embedded video vue.js?
Autoplay function in embedded video vue.js?

Time:12-17

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>

CodePudding user response:

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!

  • Related