我只播放预览(0:30),但我想要播放充满歌曲(3:10)。 我试过某种方式,但它没有成功。它也在播放预览 我怎么玩充满歌曲的呢?
mediaplayer是MediaElement。
mediaplayer.Source = new Uri("https://api.spotify.com/v1/tracks/4pn0G7yHNfTgRYRWca8gYA",UriKind.RelativeOrAbsolute);
or
mediaplayer.Source = new Uri(Stream_url.preview_url.ToString(), UriKind.RelativeOrAbsolute);
"href" : "https://api.spotify.com/v1/tracks/4pn0G7yHNfTgRYRWca8gYA",
{
"href" : "https://api.spotify.com/v1/albums/60mvULtYiNSRmpVvoa3RE4/tracks?offset=0&limit=50",
"items" : [ {
"artists" : [ {
"external_urls" : {
"spotify" : "https://open.spotify.com/artist/0TnOYISbd1XYRBk9myaseg"
},
"href" : "https://api.spotify.com/v1/artists/0TnOYISbd1XYRBk9myaseg",
"id" : "0TnOYISbd1XYRBk9myaseg",
"name" : "Pitbull",
"type" : "artist",
"uri" : "spotify:artist:0TnOYISbd1XYRBk9myaseg"
}, {
"external_urls" : {
"spotify" : "https://open.spotify.com/artist/2DlGxzQSjYe5N6G9nkYghR"
},
"href" : "https://api.spotify.com/v1/artists/2DlGxzQSjYe5N6G9nkYghR",
"id" : "2DlGxzQSjYe5N6G9nkYghR",
"name" : "Jennifer Lopez",
"type" : "artist",
"uri" : "spotify:artist:2DlGxzQSjYe5N6G9nkYghR"
}, {
"external_urls" : {
"spotify" : "https://open.spotify.com/artist/2OjoIDVPQKT9B7loZbPEfp"
},
"href" : "https://api.spotify.com/v1/artists/2OjoIDVPQKT9B7loZbPEfp",
"id" : "2OjoIDVPQKT9B7loZbPEfp",
"name" : "Claudia Leitte",
"type" : "artist",
"uri" : "spotify:artist:2OjoIDVPQKT9B7loZbPEfp"
} ],
"available_markets" : [ "AD", "AR", "AT", "AU", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "ES", "FR", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "MC", "MT", "MX", "MY", "NI", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SG", "SI", "SK", "SV", "TR", "TW", "UY" ],
"disc_number" : 1,
"duration_ms" : 222466,
"explicit" : false,
"external_urls" : {
"spotify" : "https://open.spotify.com/track/4pn0G7yHNfTgRYRWca8gYA"
},
"href" : "https://api.spotify.com/v1/tracks/4pn0G7yHNfTgRYRWca8gYA",
"id" : "4pn0G7yHNfTgRYRWca8gYA",
"name" : "We Are One (Ole Ola) [The Official 2014 FIFA World Cup Song]",
"preview_url" : "https://p.scdn.co/mp3-preview/4e6c03963fa6a6720648540282afc75f4df744c9",
"track_number" : 1,
"type" : "track",
"uri" : "spotify:track:4pn0G7yHNfTgRYRWca8gYA"
} ],
"limit" : 50,
"next" : null,
"offset" : 0,
"previous" : null,
"total" : 1
}
答案 0 :(得分:1)
在这个问题出现时,没有办法在网上播放完整曲目。对于那些将来看这个的人,您现在可以使用Web Playback SDK了!
https://beta.developer.spotify.com/documentation/web-playback-sdk/
Web Playback SDK是客户端JavaScript库,允许您在Spotify Connect中创建新播放器,并通过Encrypted Media Extensions在浏览器中播放Spotify中的任何音轨。这与我们用于支持Web Player体验的技术相同。
您可以使用Web Playback SDK执行的一些操作:
快乐的黑客攻击!