Audiobook plugin


#21

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 ?


#22

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.


#23

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.