I am implementing a SMAPI service for podcasts. Following the documentation here I have set my Item Type to track and am returning positionInformation with the getMediaUri call.
However Sonos ignores the position information and plays the track from the start every time.
getMetadata response:
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.sonos.com/Services/1.1">
<soap:Body>
<ns:getMetadataResponse>
<ns:getMetadataResult>
<ns:index>0</ns:index>
<ns:count>41</ns:count>
<ns:total>41</ns:total>
<ns:mediaMetadata>
<ns:id>track::123</ns:id>
<ns:itemType>track</ns:itemType>
<ns:title>Test track 1</ns:title>
<ns:mimeType>audio/mp3</ns:mimeType>
<ns:trackMetadata>
<ns:artistId>A:123456</ns:artistId>
<ns:artist>Test Artist</ns:artist>
<ns:albumid>M:123456</ns:albumid>
<ns:album>test Album</ns:album>
<ns:duration>600</ns:duration>
<ns:albumArtURI>http://example.com/images/aa/1.jpg</ns:albumArtURI>
<ns:canSkip>false</ns:canSkip>
<ns:canResume>true</ns:canResume>
<ns:canAddToFavorites>false</ns:canAddToFavorites>
</ns:trackMetadata>
</ns:mediaMetadata>
...
getMediaUri response:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.sonos.com/Services/1.1">
<s:Body>
<ns:getMediaURIResponse>
<ns:getMediaURIResult>https://my-sonos-service.com/testaudio.mp3</ns:getMediaURIResult>
<ns:positionInformation>
<ns:id>track::123</ns:id>
<ns:index>0</ns:index>
<ns:offsetMillis>30000</ns:offsetMillis>
</ns:positionInformation>
</ns:getMediaURIResponse>
</s:Body>
</s:Envelope>
It seems that the issue was in the duration, the test track was longer in duration than the 600 seconds I manually typed. After setting the duration to anything equal or longer than the track, the position information was followed by sonos.