I am using the command with both arguments "upnp-cmd SetAVTransportURI <URI> <URIMetaData>" because I found that specifying only the URI does not set the current file name/title on the wdtv playback gui, and it uses the name of the last file played instead. So I'm also including the URIMetaData in its <DIDL-Lite> tag to set the file's title to show correctly on the gui.
I can't find a way to properly escape the file URI inside the URIMetaData. It appears to require the file URI to be include in the child <res> tag, and I think this is where I need to escape that apostrophe. I've tried the typical methods, like ' or \' or %27 but then the wdtv either leaves those entities untouched or double-escapes them.
I looked inside the upnp-cmd php file and its passing the URIMetaData through htmlentities(), but that function doesn't do anything to apostrophes.
If I manually play the file using the regular wdtv remote, and then run "upnp-cmd GetMediaInfo" via telnet, it shows the apostrophe escaped as %27. But the question is, how do I format the URIMetaData so that the wdtv receives the apostrophe in the format it needs?
Here's an example of the URIMetaData I'm testing with:
- Code: Select all
$meta = '<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"><item><dc:title>' . 'Test' . '</dc:title><upnp:class>object.item.videoItem</upnp:class><res protocolInfo="file-get:*:video/x-matroska::DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=00000000001000000000000000000000">' . 'file:///tmp/media/usb/USB1/A02CCBB62CCF93BE/Video/A Midsummer\'s Nice Dreams.mkv' . '</res></item></DIDL-Lite>';