1

I only playing the preview(0:30) but I want playing full of songs(3:10). I had tried to some ways but it's not success.It also playing preview How do I play full of songs it?

mediaplayer is 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

}

hoang lethien
  • 77
  • 2
  • 10
  • 1
    Doesn't look like it's possible at the moment. http://stackoverflow.com/questions/24705253/play-full-spotify-track-inside-my-own-website-using-spotify-web-api – Chris Hobbs Jun 05 '15 at 16:27

1 Answers1

1

At the time of this question, there was no way to play full tracks in the web. For those of you looking at this in the future, you can now use the Web Playback SDK!

https://beta.developer.spotify.com/documentation/web-playback-sdk/

The Web Playback SDK is client-side JavaScript library which allows you to create a new player in Spotify Connect and play any audio track from Spotify in the browser via Encrypted Media Extensions. It’s the same technology we use to power our Web Player experience.

Some things you can do with the Web Playback SDK:

  • Create a new player in Spotify Connect
  • Stream an audio track in supported browsers
  • Get metadata for the current track
  • Get metadata about the user’s listening session
  • Control local playback (pause, resume, volume, etc)

Happy hacking!

arirawr
  • 1,110
  • 8
  • 21