如何从 smapi 服务器触发云队列?
how to trigger cloud queue from smapi server?
正在尝试在 Sonos 上配置音乐服务。我一直在关注编程无线电的 Sonos 指南。
https://developer.sonos.com/build/content-service-add-features/add-programmed-radio/
但不确定应该从 smapi 服务器返回什么来让播放器使用清单中声明的端点。
这是这张图中的第三步。
https://developer-assets.ws.sonos.com/doc-assets/prog_radio_seq10_review.png
我已经尝试将收音机添加为 itemType 并使用一些现有类型,但到目前为止我还没有让播放器向云队列服务器发出任何请求。
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns2:getMetadataResponse
xmlns:ns2="http://www.sonos.com/Services/1.1">
<ns2:getMetadataResult>
<ns2:index>0</ns2:index>
<ns2:count>2</ns2:count>
<ns2:total>2</ns2:total>
<ns2:mediaCollection>
<ns2:id>smapicontainer:31</ns2:id>
<ns2:itemType>radio</ns2:itemType>
<ns2:title>radio collection</ns2:title>
</ns2:mediaCollection>
<ns2:mediaMetadata>
<ns2:id>smapicontainer:32</ns2:id>
<ns2:itemType>radio</ns2:itemType>
<ns2:title>radio metadata</ns2:title>
</ns2:mediaMetadata>
</ns2:getMetadataResult>
</ns2:getMetadataResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
期待看到一些对无线电类型端点的调用。这是在清单中声明的。清单似乎配置正确,因为它在播放示例曲目时确实会调用 /radio/timePlayed。
{
"schemaVersion": "1.0",
"endpoints": [
{
"type": "radio",
"uri": "https://13467fb8.ngrok.io/flight/radio"
},{
"type": "reporting",
"uri": "https://13467fb8.ngrok.io/flight/radio"
}
],
"presentationMap": {
"uri": "https://13467fb8.ngrok.io/flight/assets/presentationmap.xml",
"version": 2
},
"strings": {
"uri": "https://13467fb8.ngrok.io/flight/assets/strings.xml",
"version": 2
}
}
更新了带有 mediaMetaData 和 itemType 程序的 smapi 响应。似乎仍然缺少一些东西,因为清单 "radio" 端点确实阻止了对 smapi 服务器的调用。但它仍然没有向与无线电关联的端点发出任何请求。选择项目时,我收到 "unable to play selected item" 提醒。
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns2:getMetadataResponse
xmlns:ns2="http://www.sonos.com/Services/1.1">
<ns2:getMetadataResult>
<ns2:index>0</ns2:index>
<ns2:count>3</ns2:count>
<ns2:total>3</ns2:total>
<ns2:mediaMetadata>
<ns2:id>prad:32</ns2:id>
<ns2:itemType>program</ns2:itemType>
<ns2:title>radio channel a</ns2:title>
</ns2:mediaMetadata>
<ns2:mediaMetadata>
<ns2:id>smapicontainer:33</ns2:id>
<ns2:itemType>program</ns2:itemType>
<ns2:title>radio channel b</ns2:title>
</ns2:mediaMetadata>
<ns2:mediaMetadata>
<ns2:id>radio:34</ns2:id>
<ns2:itemType>program</ns2:itemType>
<ns2:title>radio channel c</ns2:title>
</ns2:mediaMetadata>
</ns2:getMetadataResult>
</ns2:getMetadataResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
以下是我可以生成到清单文件中端点的唯一流量。
类型收音机没有,但如果我播放 smapi 示例服务器中包含的示例曲目之一,请获取一些报告。
image of traffic to the endpoint
您应该为 getMetadataResponse
返回 mediaMetadata
个对象的数组,itemType
为 program
。参见 https://musicpartners.sonos.com/node/286
您需要在无线电和报告端点的某处添加版本号。有关详细信息,请参阅 Sonos Music API service reporting and manifest file。
正在尝试在 Sonos 上配置音乐服务。我一直在关注编程无线电的 Sonos 指南。
https://developer.sonos.com/build/content-service-add-features/add-programmed-radio/
但不确定应该从 smapi 服务器返回什么来让播放器使用清单中声明的端点。
这是这张图中的第三步。
https://developer-assets.ws.sonos.com/doc-assets/prog_radio_seq10_review.png
我已经尝试将收音机添加为 itemType 并使用一些现有类型,但到目前为止我还没有让播放器向云队列服务器发出任何请求。
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns2:getMetadataResponse
xmlns:ns2="http://www.sonos.com/Services/1.1">
<ns2:getMetadataResult>
<ns2:index>0</ns2:index>
<ns2:count>2</ns2:count>
<ns2:total>2</ns2:total>
<ns2:mediaCollection>
<ns2:id>smapicontainer:31</ns2:id>
<ns2:itemType>radio</ns2:itemType>
<ns2:title>radio collection</ns2:title>
</ns2:mediaCollection>
<ns2:mediaMetadata>
<ns2:id>smapicontainer:32</ns2:id>
<ns2:itemType>radio</ns2:itemType>
<ns2:title>radio metadata</ns2:title>
</ns2:mediaMetadata>
</ns2:getMetadataResult>
</ns2:getMetadataResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
期待看到一些对无线电类型端点的调用。这是在清单中声明的。清单似乎配置正确,因为它在播放示例曲目时确实会调用 /radio/timePlayed。
{
"schemaVersion": "1.0",
"endpoints": [
{
"type": "radio",
"uri": "https://13467fb8.ngrok.io/flight/radio"
},{
"type": "reporting",
"uri": "https://13467fb8.ngrok.io/flight/radio"
}
],
"presentationMap": {
"uri": "https://13467fb8.ngrok.io/flight/assets/presentationmap.xml",
"version": 2
},
"strings": {
"uri": "https://13467fb8.ngrok.io/flight/assets/strings.xml",
"version": 2
}
}
更新了带有 mediaMetaData 和 itemType 程序的 smapi 响应。似乎仍然缺少一些东西,因为清单 "radio" 端点确实阻止了对 smapi 服务器的调用。但它仍然没有向与无线电关联的端点发出任何请求。选择项目时,我收到 "unable to play selected item" 提醒。
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns2:getMetadataResponse
xmlns:ns2="http://www.sonos.com/Services/1.1">
<ns2:getMetadataResult>
<ns2:index>0</ns2:index>
<ns2:count>3</ns2:count>
<ns2:total>3</ns2:total>
<ns2:mediaMetadata>
<ns2:id>prad:32</ns2:id>
<ns2:itemType>program</ns2:itemType>
<ns2:title>radio channel a</ns2:title>
</ns2:mediaMetadata>
<ns2:mediaMetadata>
<ns2:id>smapicontainer:33</ns2:id>
<ns2:itemType>program</ns2:itemType>
<ns2:title>radio channel b</ns2:title>
</ns2:mediaMetadata>
<ns2:mediaMetadata>
<ns2:id>radio:34</ns2:id>
<ns2:itemType>program</ns2:itemType>
<ns2:title>radio channel c</ns2:title>
</ns2:mediaMetadata>
</ns2:getMetadataResult>
</ns2:getMetadataResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
以下是我可以生成到清单文件中端点的唯一流量。 类型收音机没有,但如果我播放 smapi 示例服务器中包含的示例曲目之一,请获取一些报告。 image of traffic to the endpoint
您应该为 getMetadataResponse
返回 mediaMetadata
个对象的数组,itemType
为 program
。参见 https://musicpartners.sonos.com/node/286
您需要在无线电和报告端点的某处添加版本号。有关详细信息,请参阅 Sonos Music API service reporting and manifest file。