Thursday, August 24, 2023

Autoplay for embeded YouTube music thingy

 Tried to post the code I use on the webpages so writing it here is easier lol. Sorry about replying late -v-.

You can't upload MP3 files on Neocities if you aren't a supporter but you can use youtube embeds! Personally got the singular video autoplay div thingy from CaptainHowdie, and I can't remember where I actually got the autoplay thingy for the playlist.



PLAYLIST:


<div class="player">

  <iframe width="1" height="1" src="https://www.youtube.com/embed/videoseries?list=PLDNYQQtIufCnoBsc19QkkpH9Ne1b_oGRs&autoplay=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

</div>




&autoplay=1  specifically works for playlist, I've tried to use "?autoplay=1&controls=1&loop=1" to autoplay playlists but that doesn't work. It just doesn't play ~(>_<。)\


Basically for the singular video embed put "?autoplay=1&controls=1&loop=1" at the end of the link to the video. And set the width & height to 1 for both of them.

Then for playlist embeds you do the same thing but you put "&autoplay=1" at the end of the playlist link instead.





SINGLE VIDEO:


  <div class="player">

  <iframe width="1" height="1" src="https://www.youtube.com/embed/OMf-7ltC1YY?autoplay=1&controls=1&loop=1" title="butterflies" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

</div>





Sorry for replying late ━━( ̄ー ̄*|||━━

No comments:

Post a Comment

Getting photos developed!!!!

 Getting photos of me and some friends, and loads of photos of my cat developed.... Have been finding all these old BlogSpot sites from a de...