Kodi Community Forum

Full Version: Create UPnP url from file path/ids returned in normal json queries
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I am able to list all the media stored on XBMC system using JSON APIs on the c++ client. My goal is to play the media file on client side. UPnP server configured on XBMC. I want to make UPnP url for browsed items through the JSON apis, without browsing through UPnP framework. Result UPnP url need to use for media playback with UPnP media player. Basically is would like to avoid dual browsing for the contents. I have currently limited knowledge about both the browsing methods but assuming JSON will give more control on XBMC so wanted to stick to single protocol.

Need help to resolve this issue or please suggest if i picked the wrong way here.
thanks
Why do you need UPnP? xmbc's webserver supports file streaming as well so you can try to play
Code:
http://<ip>:<port>/vfs/<url-encode(path-to-file-from-jsonrpc)>
The main difference between UPnP and xbmc webserver url is authentication...

If authentication is enabled in the xbmc webserver you will also have to provide basic auth credentials when trying to play the file. Authentication headers are not supported by every media player natively (for instance on android support starts with api level 14)...

BTW: Even if you somehow manage to build / guess the upnp url you will have to browse to the directory using upnp first to "unlock" the file for streaming and you have the limitation that you need to be on the same network
thank you all for resolving this issue, i got working through "VFS" and thank you realising authentication issues.