« Web, HTML, Tech Forum

my youtube autoplay wont work??

Posted by Taylor ☘︎ πŸƒŸ

posted
updated

Forum: Web, HTML, Tech

Ive been using a code for an autoplay youtube video since the day i set up my page. until just now the music has been autoplaying just fine. All of sudden the video wont autoplay! My friend has the same code on their page and its working just fine. Ive noticed that my code also works when I have my page open in another tab or window and the video is played and then paused. Very strange.


Code Im using:


<iframe width="300" height="50" src="https://www.youtube.com/embed/_uhaU5ca0Bs//?&;amp;;autoplay=1&;loop=1&;controls=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" loading="lazy">

</iframe>


Any ideas as to why its not autoplaying?


edit: got it to work again by doing nothing, still wondering why it happened in the first place tho! lol


Report Topic

1 Reply

Reply by ニーチェはクソだ

posted
updated

Are you sure your friend uses "the same code"? After looking at a few things it seems to work correctly for me, but there are a couple of things that are missing or need to be fixed.

First, tf is that amp thing? You don't need it for it to work. You can delete it.
Should be like this:
OG CODE: "src="YoutubeURLEmbed//?&;amp;;"
FIXED: "src="YoutubeURLEmbed?autoplay=1 and so on..."

You also have an unnecessary space in the full screen setting part:
OG CODE: "allowfullscreen="" loading="lazy"
FIXED: "allowfullscreen loading="lazy"

After fixing that, the autoplay works just fine. I usually have problems explaining things, so if you don't understand something let me know.

EDIT: At this point I guess I could just share the fixed code too! Seems like you fixed it so just letting this here in case it is useful to someone else.

<iframe width="300" height="50" src="https://www.youtube.com/embed/_uhaU5ca0Bs?autoplay=1&loop=1&controls=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen loading="lazy">


</iframe>


Permalink Report Reply