suspendlabs / lstn

Lstn to Rdio with Friends
3 stars 5 forks source link

Allow users to preview songs from the search results #106

Open fishfacemcgee opened 9 years ago

fishfacemcgee commented 9 years ago

This was a feature of Turntable.FM that'd hopefully help people catch the Rdio Previews as well as supplement #105 as a way to find the song you really want.

cisox commented 9 years ago

@fishfacemcgee Michael and I talked about this today and this might be something he implements tonight. Rdio provides a link in the song data to preview songs so it should be very easy to retrieve that for the songs in the playlist and simply play through Rdio. The only challenging part is restarting playback after the sample finishes and that's just a matter of sending a notice to socket.io to get the latest track and position.

That being said, we shouldn't kill the playing sample when a new song starts (you're listening to a sample and the next broadcaster starts).

cisox commented 9 years ago

So the sampleUrl that Rdio provides is a static link to an MP3. Our best bet would be to just play the song using rdio.play() and add a timeout for 30 seconds to do the rdio.stop() and the check in with the server for the current song. We could also do a rdio.stop() on the preview button being clicked again (I'm thinking it switches to a stop button)

cisox commented 9 years ago
  1. Add code to play the song
  2. Add timeout for 30 seconds
  3. Disable regular song playing
  4. On timeout or stop button, get current song and position for track from socket.io
  5. Play current song from socket.io