Skip to content

Instantly share code, notes, and snippets.

@YanTheFawn
Created November 2, 2015 02:06
Show Gist options
  • Save YanTheFawn/1ecad4dce1229f9dc249 to your computer and use it in GitHub Desktop.
Save YanTheFawn/1ecad4dce1229f9dc249 to your computer and use it in GitHub Desktop.
I'm using the SC api, and I just had a question for you guys!
I'm noticing from the example in the docs that one has to instantiate a player every time one streams a new track:
e.g.
SC.stream('/tracks/293').then(function(player){
player.play();
});
In my current implementation, I'm invoking the above every time a new track is played (with the new url stream replacing the old)
- is this the intended use, or is there a way of pulling in the next stream without the overhead of reinitializing the player all over again? If not, it seems like I would have to re-attach all my event handlers to the new player instance every time a user clicks to a new track, which
would be quite a bit of processing everytime a user changes the track. I'm hoping that's not the case, and there's something I'm just missing :p
Let me know, and thanks!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment