spotify: implement URIHandlerImpl
It'd be great to support the URI Handler interface to make spotifyaudiosrc easier to use in existing codebase that utilise uridecoder/playbin/player etc.
My personal use-case for this is to start using spotifyaudiosrc
for playback in Mopidy-Spotify following the death of libspotify. And as part of that we'd like to get rid of all our special-case code and just set a uri on our playbin, like we do for all other sources.
As well as the track's URI, we also need to set the account credentials. Either the username/password or a path to a cached credentials directory. These properties could be set in source-setup
but that requires gst-plugins-base!1241 (merged), which is in GStreamer v1.20 and might not be available to some of our users yet (e.g. Debian stable users).
An alternative (suggested by slomo on IRC) is to set the user/pass in the URI's authority e.g. spotify://my_username:my_password@track/id
. However, that isn't ideal because:
-
That's different to the existing
spotify:track:id
scheme in place and it's a bit weird to have both. -
Doesn't provide a nice way to set the cached credentials instead (which is the better was as Spotify send you a "New login detected" email every time you login using username + password).
So maybe it's better to support spotify:track:id?username=my_username&password=my_password
instead? And then we could have spotify:track:id?cache-credentials=%2Fhome%2Fnick%2Fmy_spotify_creds
also?
I've implemented both versions in https://gitlab.freedesktop.org/kingosticks/gst-plugins-rs/-/tree/spotify-uri-handler but not sure which one to go with. Any thoughts?