admin管理员组文章数量:1332395
I have the artist, track, and album from LastFM API stored in a widget. I would like to play a 30 second snippet of the song from Spotify when a user clicks play. Is it possible to do this? I'm struggling to find a way.. Especially without user authentication / permissions.
Spotify App API: Play specific track from album
This looks promising, but I'm not sure if it's what I'm talking about...
If someone could point me in the right direction (what API calls to use), that would be great! I can figure out the rest from there.
I have the artist, track, and album from LastFM API stored in a widget. I would like to play a 30 second snippet of the song from Spotify when a user clicks play. Is it possible to do this? I'm struggling to find a way.. Especially without user authentication / permissions.
Spotify App API: Play specific track from album
This looks promising, but I'm not sure if it's what I'm talking about...
If someone could point me in the right direction (what API calls to use), that would be great! I can figure out the rest from there.
Share Improve this question edited May 23, 2017 at 11:51 CommunityBot 11 silver badge asked Jul 28, 2014 at 19:51 kwitbkwitb 111 silver badge4 bronze badges2 Answers
Reset to default 4In the Spotify API documentation I found a link to this github repo that uses the 30-sec API calls to build a web player you can check out here. I believe you want the track API:
preview_url string A link to a 30 second preview (MP3 format) of the track.
You can get the track preview_url
from a search response, too.
If you know the artist and track title:
https://api.spotify./v1/search?q=artist:Lady+Gaga+title:Bad+Romance&type=track&limit=1
if you know the ISRC:
https://api.spotify./v1/search?q=isrc:US2J71103806&type=track
本文标签: javascriptPlay a Track Using Spotify Web APIStack Overflow
版权声明:本文标题:javascript - Play a Track Using Spotify Web API - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742282426a2446339.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论