Note that there are some explanatory texts on larger screens.

plurals
  1. POFetch all DLNA root storage directories in Cling?
    primarykey
    data
    text
    <p>I'm using the awesome <code>Cling</code> library to scan my network for UPnP devices. My goal is to throw together a little DLNA library browser so I can learn the technology. I have so far been able to 1. scan the network and get connected UPnP devices, 2. scan each remote device and determine if it has a DLNA service running, and 3. browse immediate children of known nodes. In short, this is my method that is able to run all of this:</p> <pre><code> public void remoteDeviceAdded(Registry registry, RemoteDevice device) { logger.debug("remote device added: {}[{}]", device.getDetails().getFriendlyName(), device.getType().getType()); if (device.getType().getType().equals("MediaServer")) { for (RemoteService service : device.getServices()) { if (service.getServiceType().getType().equals("ContentDirectory")) { // '1' is Music, '2' is Video, '3' is Pictures this.service.getControlPoint().execute(new Browse(service, "3", BrowseFlag.DIRECT_CHILDREN) { @Override public void received(ActionInvocation arg0, DIDLContent didl) { logger.debug("found {} items.", didl.getItems().size()); } @Override public void updateStatus(Status arg0) { }; @Override public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2) { }; }); } } } } </code></pre> <p>I know, it probably looks like a horrible mess and it is, but it works :) When I drop into a debugger, I can see what I've got. However, unlike the instructions from the guide <a href="http://teleal.org/projects/cling/support/manual/cling-support-manual.html#javadoc.example.mediaserver.ContentDirectoryBrowseTest" rel="noreferrer">here</a>, I don't get back any actual media items, just storage directories in the browse result. This kind of makes sense as DLNA organizes things into a hierarchy like so:</p> <pre><code>Music All Music Artists Fleetwood Mac ... Albums ... Video All Video Folders ... </code></pre> <p>My question is this, what's the easiest way to browse these folders and climb through the hierarchy? I'm already at a point where I'm connected to the UPnP DLNA server that I was looking for, now how do I get these root storage directories? In the browse command given above, I have to actually pass a string representation of some index to get "Music" or "Video" or the like. How do I get the top level of storage directories, then how can I browse each one of those directories? My goal is to at least build a simple browser. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload