Saturday, 28 September 2013

Dragging track from spotify depends on source

Dragging track from spotify depends on source

Using spotify's client on windows 7, when dragging a track from a playlist
into a browser the dropped element has several options:
event.dataTransfer.getData("text/plain") returns an open.spotify.com URL
such as http://open.spotify.com/track/3OpUG4N7Igc6ZbC0SONuVc
event.dataTransfer.getData("text/uri-list") returns a spotify URI such as
spotify:track:4w8CsAnzn0lXJxYlAuCtCW
However if you are on the Artist's page, e.g. if you search for Lorde and
then drag a track into the browser both text/plain and text/uri-list
return the open.spotify.com URL
(http://open.spotify.com/track/4w8CsAnzn0lXJxYlAuCtCW). The same happens
when dragging a link to a track from the discover tab.
Is it likely that one will change so they both implement the same
behaviour? I want to develop a site that handles spotify objects being
dropped from anywhere in the client.
Note the http://play.spotify.com site doesn't appear to implement drag and
drop of any elements.

No comments:

Post a Comment