How to autoplay Spotify playlist URI?

ぃ、小莉子 提交于 2021-01-29 17:26:30

问题


Currently developing a website that embeds a spotify playlist with its URI as so: "https://embed.spotify.com/?uri=spotify:playlist:4hYaUylcBHW9Se152NoIy0" I'm wondering if there's an autoplay parameter that allows the playlist to play automatically when the web page is loaded ?

It seems like this idea (to have an autoplay parameter) has been proposed before in these posts: (But none of them have gotten enough votes to succeed) https://community.spotify.com/t5/Closed-Ideas/All-Platforms-Autoplay-Parameter-for-Spotify-URIs/idi-p/1320044 The post above mentions doing something like this: spotify:user:Username:playlist:PlaylistCode:autoplay:true (would play it just as you click on the link) spotify:user:Username:playlist:PlaylistCode:autoplay:false (would not play it, you would need to press the play button) This post (http://routenote.com/blog/how-to-embed-and-customise-spotify-in-websites-and-blogs/comment-page-1/#comment-428929) suggests that you can add parameters to view the cover art or change the color of your playlists (didn't work when I tried that), so I'm wondering if there's a similar parameter for autoplay? This post (Spotify Play Button - autoplay?) says it doesn't, but this was from 2012.

And if there is no autoplay parameter, is there a way to autoplay a Spotify playlist via the Spotify Web API? According to this Stack Overflow post (Update on Spotify API not allowing auto play) , there was a glitch with autoplaying Spotify tracks, but I'm wondering if there's a built-in way to autoplay Spotify playlists?

Lastly, if the Spotify Web API does not allow playlists to autoplay, do others know of the platforms that allow that? This post mentions Soundcloud and Vimeo as other options: Spotify Play Button - autoplay?

Thanks so much!


回答1:


The playlists don't seem to have an autoplay option

If the playlist is embedded in you own website you can click the play button using javascript.

document.querySelector('[title="Play"]').click()


来源:https://stackoverflow.com/questions/57566177/how-to-autoplay-spotify-playlist-uri

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!