Search code examples
sonos

A Sonos Music API (SMAPI) implementation, during the test service getting unable to play music connection to service was lost


Have setup dummy service with static value in php and till to getMediaURI method everything is working means getting that list and all but once clicking on item to play song in sonos speaker getting unable to play music due to service was lost error.


Solution

  • I noticed in your samples that the <id> format appears to be inconsistent. The format is sometimes <ns:id>track61</ns:id> and sometimes delimited with a colon <ns1:id>track:610294458</ns1:id>. SMAPI will often choke if the requested <id> doesn't match the <id> in the response.

    I only see the <ns:getMediaURIResponse> and not the request (same for the other SMAPI calls), so I'm not sure if this is what you're doing. Just make sure that if the Sonos client requests <id>track:123</id>, the value of <id> in your response matches precisely.