Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Device Icon
03-10-2013, 10:53 AM
Post: #1
Device Icon
Hi,
Sorry another question.

I am looking at how to add a Device Icon for my media renderer.

So far the only way I have found is to create my own xml and then set the attribute 'Upnp.IconList' but I have some questions.

Using this method, if I wanted to display a local icon rather than use an external url do I have to implement an http server or is there something in ohNet that I could use.

Are there any better methods to add a Device Icon

Code:
        iDevice = new DvDeviceFactory(ds).createDeviceStandard(iDeviceName, this);
        log.debug("Created StandardDevice: " + iDevice.getUdn());
        sb.append("<icon>");
        sb.append("<minetype>image/png</minetype>");
        sb.append("<width>1006</width>");
        sb.append("<height>1006</height>");
        sb.append("<depth>24</depth>");
        sb.append("<url>http://img87.imageshack.us/img87/5673/rotatetrans.png</url>");
        sb.append("</icon>");
        iDevice.setAttribute("Upnp.IconList" , sb.toString());

Thanks,

Pete.
Find all posts by this user
03-10-2013, 01:03 PM
Post: #2
RE: Device Icon
(03-10-2013 10:53 AM)PeteManchester Wrote:  I am looking at how to add a Device Icon for my media renderer.

So far the only way I have found is to create my own xml and then set the attribute 'Upnp.IconList' but I have some questions.

Using this method, if I wanted to display a local icon rather than use an external url do I have to implement an http server or is there something in ohNet that I could use.

Are there any better methods to add a Device Icon

You can use the device stack's http server if you report your icon files as being under a resource directory (relative to your device xml).

To try this, pass an IResourceManager instance into your DvDeviceStandard code and change your iconList xml:

Code:
sb.append("<url>resource/img87/5673/rotatetrans.png</url>");

GETs for this file will now passed to your resource manager's writeResource function.
Find all posts by this user
03-10-2013, 06:31 PM
Post: #3
RE: Device Icon
(03-10-2013 01:03 PM)simonc Wrote:  
(03-10-2013 10:53 AM)PeteManchester Wrote:  I am looking at how to add a Device Icon for my media renderer.

So far the only way I have found is to create my own xml and then set the attribute 'Upnp.IconList' but I have some questions.

Using this method, if I wanted to display a local icon rather than use an external url do I have to implement an http server or is there something in ohNet that I could use.

Are there any better methods to add a Device Icon

You can use the device stack's http server if you report your icon files as being under a resource directory (relative to your device xml).

To try this, pass an IResourceManager instance into your DvDeviceStandard code and change your iconList xml:

Code:
sb.append("<url>resource/img87/5673/rotatetrans.png</url>");

GETs for this file will now passed to your resource manager's writeResource function.

Thanks Simon that worked, I used to wonder what the resource manager was for....
Find all posts by this user


Forum Jump: