jgdsm wrote:It should transparently work with any DLNA server though since the TV/client is responsible for storing last positions and telling the the server to deliver starting from either 0:00:00:00 or somewhere else.
It's not correct. TV is not responsible for storing last positions, but the server (Samsung PC Share Manager). This is reason why it's not working with the others servers, because they don't support it.
zip, I can help you to implement resume feature for C series. Today I spend lot of time with sniffing and I think I understood how it works.
First you need to implement X_SetBookmark operation, Samsung TV uses this operation to remember last video position.
So TV sends this request to server when video is stopped:
- Code:
POST /upnp/control/ContentDirectory1 HTTP/1.0
HOST: 192.168.100.100:52235
CONTENT-LENGTH: 339
CONTENT-TYPE: text/xml;charset="utf-8"
USER-AGENT: DLNADOC/1.50
SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#X_SetBookmark"
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:X_SetBookmark xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><ObjectID>46</ObjectID><PosSecond>58</PosSecond><CategoryType>10</CategoryType><RID>0</RID></u:X_SetBookmark></s:Body></s:Envelope>
Serviio response for this request is:
- Code:
HTTP/1.1 500 Internal Server Error
CONTENT-LENGTH: 399
CONTENT-TYPE: text/xml; charset="utf-8"
DATE: Fri, 07 Jan 2011 15:16:27 GMT
EXT:
SERVER: MS-Windows/XP UPnP/1.0 PROTOTYPE/1.0
Samsung PC Share Manager 4.2 response is:
- Code:
HTTP/1.1 200 OK
CONTENT-LENGTH: 265
CONTENT-TYPE: text/xml; charset="utf-8"
DATE: Fri, 07 Jan 2011 15:15:24 GMT
EXT:
SERVER: MS-Windows/XP UPnP/1.0 PROTOTYPE/1.0
- Code:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:X_SetBookmarkResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"></u:X_SetBookmarkResponse></s:Body></s:Envelope>
So, Serviio needs to process this request and remember client id, object_id, position in seconds. This is the first part.
The second change is required in DirectoryBrowsing
This is normal Servii DirectoryBrowsing response:
- Code:
<?xml version="1.0" encoding="utf-8" ?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><u:BrowseResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><Result><?xml version="1.0" encoding="UTF-8" standalone="no"?><DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:sec="http://www.sec.co.kr/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"><item id="V_F#FOL_R10$F137$MI1062" parentID="V_F#FOL_R10$F137" restricted="1"><dc:title>Bourne_Identity.mp4</dc:title><upnp:class>object.item.videoItem</upnp:class><dc:date>2002-06-14</dc:date><upnp:genre>Action</upnp:genre><res bitrate="593000" duration="1:58:17.000" protocolInfo="http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_HD_1080i_AAC;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000" resolution="1920x1080" size="4209226587">http://192.168.100.100:8895/resource/1062/MEDIA_ITEM/AVC_MP4_MP_HD_1080i_AAC</res><res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_OP=00;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=00D00000000000000000000000000000" resolution="106x160">http://192.168.100.100:8895/resource/1034/COVER_IMAGE</res><res protocolInfo="http-get:*:smi/caption:*">http://192.168.100.100:8895/resource/1062/SUBTITLE.srt</res><sec:CaptionInfoEx sec:type="srt">http://192.168.100.100:8895/resource/1062/SUBTITLE.srt</sec:CaptionInfoEx></item></DIDL-Lite></Result><NumberReturned>1</NumberReturned><TotalMatches>1</TotalMatches><UpdateID>2</UpdateID></u:BrowseResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
This is Samsung PC Share Manager response:
- Code:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:BrowseResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><Result><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/' xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:sec="http://www.sec.co.kr/"><item id="46" parentID="12" restricted="1"><dc:title>Bourne_Identity</dc:title>
<upnp:class>object.item.videoItem</upnp:class>
<sec:dcmInfo>CREATIONDATE=0,FOLDER=The Bourne Identity,BM=58</sec:dcmInfo>
<dc:date>2010-07-11</dc:date>
<sec:CaptionInfoEx sec:type="srt">http://192.168.100.100:53235/46.SRT</sec:CaptionInfoEx>
<sec:MetaFileInfo sec:type="mta">http://192.168.100.100:53235/46.MTA</sec:MetaFileInfo>
<res protocolInfo="http-get:*:video/mp4:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000" size="4209226587" resolution="1920x1080" duration="1:58:17">http://192.168.100.100:53235/46.MP4</res>
<res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=00D00000000000000000000000000000">http://192.168.100.100:53235/46.MTN</res>
</item>
</DIDL-Lite></Result><NumberReturned>1</NumberReturned><TotalMatches>1</TotalMatches><UpdateID>0</UpdateID></u:BrowseResponse></s:Body></s:Envelope>
Important part for us is:
- Code:
<sec:dcmInfo>CREATIONDATE=0,FOLDER=The Bourne Identity,BM=58</sec:dcmInfo>
BM=58 is remembered last video position in seconds. (PosSecond element from X_SetBookmark request)
I think that's all what needs to be implemented.
Feel free to contact me via PM, maybe it will be easier for me to explain it in Czech/Slovak.