Hello All,
There is a python file in the test directory of renderer-service-upnp called
rendererconsole.py.
It contains some python classes that make it easy to invoke the various
renderer-service-upnp methods from python.
It is very close to mediaconsole.py (in media-service-upnp directory) in its use.
If renderer-service-upnp is well installed, you can launch this script as following to
have a quick overview of what you can do :
$ python rendererconsole.py
The main function prints the list of renderers currently available in the local networks.
It also prints for each renderers the list of the DBus interfaces and the properties of
the com.intel.UPnP.RendererDevice interface.
In interactive mode, you can do this as following :
$ python
>> from rendererconsole import *
>> manager_renderers = Manager()
>> manager_renderers.renderers() # prints the renderers
available
/com/intel/RendererServiceUPnP/server/0 : Audio/Video playback on
MyLapTop
/com/intel/RendererServiceUPnP/server/1 : XBMC server
>> renderer =
Renderer("/com/intel/RendererServiceUPnP/server/0")
If mediaconsole is not accessible add temporarily its path :
>> import sys
>>
sys.path.append("<dleyna_source_path>/media-service-upnp/test/")
So you can load its classes:
>> from mediaconsole import *
>> manager_media = UPNP()
>> manager_media.servers()
My media
/com/intel/MediaServiceUPnP/server/0
>> root =
Container("/com/intel/MediaServiceUPnP/server/0")
>> root.search('Type derivedfrom "video"', 0, 5,
["DisplayName", "Path", "URLs"], "-DisplayName")
Total Items: 2346
…
{
"DisplayName": "movie_1.avi",
"Path":
"/com/intel/MediaServiceUPnP/server/0/6633636233386339623830303338383838646661323366663938616666636536",
"URLs": [
"http://10.200.22.138:34941/MediaExport/i/ZjNjYjM4YzliODAwMzg4ODhkZmEyM2ZmOThhZmZjZTY%3D.avi"
]
}
{
"DisplayName": "movie_2.avi",
"Path":
"/com/intel/MediaServiceUPnP/server/0/6635346532303663343639363065323139626438306330616531326464633537",
"URLs": [
"http://10.200.22.138:34941/MediaExport/i/ZjU0ZTIwNmM0Njk2MGUyMTliZDgwYzBhZTEyZGRjNTc%3D.avi"
]
}
{
"DisplayName": "Avatar.mkv",
"Path":
"/com/intel/MediaServiceUPnP/server/0/3262356661623662636563666365333535363933356563643165356135623737",
"URLs": [
"http://10.200.22.138:34941/MediaExport/i/MmI1ZmFiNmJjZWNmY2UzNTU2OTM1ZWNkMWU1YTViNzc%3D.mkv"
]
}
And finally play a file :
>>
renderer.open_uri("http://10.200.22.138:34941/MediaExport/i/MmI1ZmFiNmJjZWNmY2UzNTU2OTM1ZWNkMWU1YTViNzc%3D.mkv")
>> renderer.play()
For two box push use case:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
>> renderer.host_file("<local_file_path>")
>> renderer.play()
Enjoy,
Sébastien Bianti