It was good advice ! Authentication works. Tried it with command line gst-launch-1.0 -v souphttpsrc ..
, so my question now is: how to use it with Mopidy? Use all these params as part of URI ?
Unfortunately I donât think you can do that, normally you have to set the property on the element. However, it doesnât seem like weâve ever needed this before in Mopidy and I donât think we have a way to do it. You need some way to have audio.Audio.on_source_setup() call your backend-specific code that sets the two properties: e.g.
source.set_property('user-id', "bob")
source.set_property('user-pw', "super-secret")
You could try adding those two lines to on_source_setup()
(with your hard-coded values) as a test and then we could add something to the API to do it properly. I can see this would be useful for other extensions.
I have exactly came to same findings yesterday. I have created in Audio
an callback, which can be called at the end of Audio._on_source_setup
with source
as input. Then I have connected function, from my PlaybackProvider
and inside it I set user-id
and user-pw
.
But then I have realized that such callback breaks idea/concept of Actor , and in fact more then one Backend
can want to use this callback, so finally there should be a list
, to allow all of them to registerâŚetcâŚ
I think now, that better long term solution would be just extend set_uri
with additional parameter, probably Dict
which could carry needed configuration settings related to uri
(track). It will be then stored by Audio
as private, and used on source
during _on_source_setup
. Then cleared, just to avoid setting it when any other PlaybackProvider
will use Audio
.