I noticed that the embed code everyone uses doesn't loop songs for me even though it's supposed to. I'm pretty sure it's because YouTube embed doesn't like to loop standalone videos -- but it does work for playlists! All you have to do is "create" a playlist using the embed code, like this:
<iframe width="0" height="0" src="https://www.youtube.com/embed/YOURVIDEOCODE?autoplay=1&loop=1&playlist=YOURVIDEOCODE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" loading="lazy" data-ruffle-polyfilled="">
</iframe>
So mine looks like this:
<iframe width="0" height="0" src="https://www.youtube.com/embed/27WKaZ3AY4U?autoplay=1&loop=1&playlist=27WKaZ3AY4U" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" loading="lazy" data-ruffle-polyfilled="">
</iframe>
If it doesn't work, try changing the word playlist to list. Note this only works for playing one song on loop, not playing an actual playlist... I haven't been able to get a playlist with multiple songs to even autoplay properly yet, let alone have it loop itself lol
Not sure if anyone has already done this, but I haven't seen it so I made this post anyway :P
Happy coding! ^__^
Comments
Displaying 11 of 11 comments ( View all | Add Comment )
H@YD3N
THANK YOUUU
Araminta
Thank u so much
It worked, u have no idea how happy I am right now!!!!
TobsterFire
THANK YOU SO MUCH FOR THIS
sena ) romeo ★
THIS WORKED TYSMMM I OWE YOU MY LIFE
ely
IT WORKED TYSMM
💜🪽Hypershock🪽💜
TYSM!!!!!
Alden
This worked brilliantly! Thank you so so much !! ^^
LOSER
THANK YOU SO MMUCHHH
Cat as angel
Danke [Thank you], it work.
goryfacee
TYSM
NP!!! :)
by jex; ; Report
chismosnya
will be trying this cause mine doesnt loop rn🙏
lmk if it works cuz it does for me but idk if it will for anyone else LMAO
by jex; ; Report