Want to play original track in external player

Hii,

I'm using your api but I'm able to play the 30 sec demo the preview_url. But in api I do not get the original track link to play in my audio player. 
Please reply it's urgent. 

**bleep** /**bleep**

Child Item
Child Item
Child Item

Accepted answers

All comments

The Spotify link is in external_urls['spotify'] .

Additionally, if you mean "an audio player, other than Spotify" it's not going to work.

Hii thaks for reply So how do I play the songs in my portal?
here is a screenshot of my player where preview urls are working
Please check the attachment below.

Hii thanks for your reply.
I want to play the real track in external player in my portal. Please check the screenshot. How I do that using api? Do I need implement the spotify player in my portal? Have you link of that so please share.

I think I know what mean, but you need something else to play music from Spotify inside your application.

One way is to use the Web Playback SDK. The Web Playback SDK requires a Spotify Premium subscription.

Thanks for reply but is this sdk work with my current player? I have Premium account.

No, you have to rewrite parts of your player to make this work.

I forget to say that I don't think you can play a mix of local tracks and Spotify tracks this way.

I think you have to add the local tracks to a Spotify playlist first. Then your app can retrieve the URIs from that playlist and then play them.

There's a developers article about Local Files in Spotify Playlists.

Note: I haven't experience with the Spotify API together with local files, so my theory may not work.

Thanks for your reply.
I'm trying to implement the web SDK for my website but as per this tutorial it's not working (https://developer.spotify.com/documentation/web-playback-sdk/quick-start/#).
How to add this code inside of this source code?

const play = ({
  spotify_uri,
  playerInstance: {
    _options: {
      getOAuthToken
    }
  }
}) => {
  getOAuthToken(access_token => {
      method: 'PUT',
      body: JSON.stringify({ uris: [spotify_uri] }),
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${access_token}`
      },
    });
  });
};

play({
  playerInstance: new Spotify.Player({ name: "..." }),
  spotify_uri: 'spotify:track:7xGfFoTpQ2E7fRF5lN10tr',
});

 

Did you get any errors?

Hi,

No error get   
The Web Playback SDK successfully connected to Spotify!
player.connect().then(success => {
if (success) {
console.log('The Web Playback SDK successfully connected to Spotify!');
}
});
Now how do I play individual full track in my html?

Thank you

Hi, 
I did not get any error. Also sdk connected but unable to play full track.

Child Item
Child Item