I noticed the code a lot of people use to autoplay music requires scrolling to the bottom. Here's what I use, it plays without having to scroll (if anyone besides me has this issue, I'm also on mobile)
<div class="music-player" style="position: fixed; top: 0; left: 0; z-index: -1; pointer-events: none;">
<iframe width="1" height="1" src="https://www.youtube.com/embed/[video id]?rel=0&autoplay=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
Note: replace "[video id]" with the video id of the audio you want to autoplay (like dQw4w9WgXcQ in https://youtube.com/watch?v=dQw4w9WgXcQ)
Comments
Displaying 0 of 0 comments ( View all | Add Comment )