Serving the UPnP implementation in XBox 360
General discovery
A dummy X_MS_MediaServerRegistrar UPnP device must be present and allow access.
MediaServer and ContentDirectory need to be V1.
Windows Media Connect approach
modelName must begin with "Windows Media Connect"
friendlyName must end with ": 1 : Windows Media Connect"
The drawback of this approach is that it's not possible to get video thumbnails.
Windows Media Player approach
modelName must be set to "Windows Media Player Sharing"
modelNumber must be set to "11" or "12"
friendlyName must contain a colon (":")
Differences in SOAP
For "Browse" requests the XBox 360 uses the parameter ContainerID instead of the standard ObjectID as defined by UPnP forum.
For Music support the XBox 360 requires the implementation of the optional Search method on the ContentDirectory service.
Data organization
In general the XBox 360 relies on hard-coded container identifiers for the interaction with a UPnP device:
Container id |
Meaning |
used in |
15 |
Videos |
Browse |
16 |
Pictures |
Browse |
4 |
All Music |
Search |
5 |
Genre |
Search |
6 |
Artist |
Search |
7 |
Album |
Search |
F |
Playlists |
Search |
Since the containers are somewhat redundant in Search (it searches for upnp:class = "object.container.playlistContainer" in container F) we just map them to the root container, likewise for browsing.
Other quirks
The containers need to be of the class object.container.storageFolder
Images need to have the class object.item.imageItem.photo.
AVI files are accepted with the content-type video/avi.
MPEG files are not shown at all if their content-type is video/mpeg. We set an invalid content-type to force transcoding for such files.
Video thumbnails
If the UPnP server pretends to be Windows Media Player, the XBox 360 will try to get thumbnails for videos by issuing a HTTP request for the file and appending the GET parameter ?albumArt=true. Contrary to popular belief PNG is supported as well as JPEG.