In my web-app, I've embedded a spotify playlist.Now, all I want is to autoplay the playlist when the website opens or let's say when user clicks the "play" button on my website and not on the Spotify's iframe. The code for the same is:
<!DOCTYPE html>
<html>
<body>
<iframe src="https://open.spotify.com/embed/playlist/37i9dQZF1EJEjtwRUdhPUX?utm_source=generator&theme=0" width="100%" height="80" frameBorder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"></iframe>
<script>
document.querySelector('[title="Play"]').click()
</script>
</body>
</html>
The link for JS Fiddle is JS_Fiddle
I know the question is being asked before but none of the solution seems to work!