Search code examples
htmlwordpressvideoembedautoplay

Embed youtube video doesn't autoplay with audio


After checking out other posts on embedding videos that didn't help fix my issue, I seek some suggestion in making the video autoplay along with the audio as the page is visited. Below is the code embedded into my WordPress page here.

<iframe width="560" height="315" src="https://www.youtube.com/embed/ikTEJCk0Da0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

I did use query string like https://www.youtube.com/embed/ikTEJCk0Da0?autoplay=1 but it just makes the progress bar move but the video.

I did also use https://www.classynemesis.com/projects/ytembed/ to get the link, but it didn't help either.


Solution

  • Modern browsers don't allow autoplay with audio on b/c it's considered annoying.

    There are some not-easy-ways to cheat them, but only with self-hosted videos (no YouTube/Vimeo).

    Moreover there's no guarantee those methods will not stop working abruptly. Indeed they will stop abruptly soon or later (along with browsers' updates) so that new methods have to be deployed again and again.

    I suggest to give up the idea.

    P.S. I agree with browsers' developers: audio autoplay IS ANNOYING.