Sonos 播放器未调用 GetStreaming 元数据

Sonos player not calling GetStreamingMetadata

我有一个使用 HLS 的直播广播流,我想在播放歌曲时显示曲目/艺术家信息。

据我从 API 文档和问题中了解到,如果我们将 hasOutOfBandMetadata 设置为 true,则应为 HLS 调用 Streams - hasOutOfBandMetadata and getStreamingMetadata

我们 return 的 mime 类型是 "application/vnd.apple.mpegurl"。

getMetaData returns 一个频道列表,我们用这样的东西构建每个频道

return new mediaMetadata
{
    id = string.Format("{0}:{1}", Prefix, (string)channel["id"]),
    title = (string)channel["title"],
    itemType = itemType.stream,
    mimeType = "application/vnd.apple.mpegurl",
    onDemand = false,
    liveNow = true,
    Item = new streamMetadata
    {
        currentShow = "Test title",
        currentHost =  "Someone"
    }
};

和getMediaMetadata returns

return new getMediaMetadataResponse
{
    getMediaMetadataResult = new getMediaMetadataResponseGetMediaMetadataResult
    {
        Items = new object[] {
            new streamMetadata
            {
                title = (string)mediaElement["title"],
                hasOutOfBandMetadata = true,
                currentShow =  "Test",
                currentShowId =  "MKDF24444",
                description = "this is the description",
                hasOutOfBandMetadataSpecified = true
            }
        },
        ItemsElementName = new[] { ItemsChoiceType.streamMetadata }
    }
};

使用此配置我看不到对 getStreamingMetadata 的任何调用。

谢谢

我认为这里的问题可能是在您的 getMetdata 响应中您实际上应该返回 streamMetadata(而不仅仅是在 getMediaMetadata 响应中)。例如...

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <getMetadataResponse xmlns="http://www.sonos.com/Services/1.1">
      <getMetadataResult>
        <index>0</index>
        <count>3</count>
        <total>3</total>
        <mediaMetadata>
          <id>sta00001</id>
          <title>LIVE!!!! In NYC!!!!!!!!</title>
          <mimeType>audio/x-scpls</mimeType>
          <itemType>stream</itemType>
          <streamMetadata>
            <logo>http://example.com/sta00003.png</logo>
            <currentHost>Donna Summer</currentHost>
            <currentShow>Advanced D&D</currentShow>
          </streamMetadata>
        </mediaMetadata>        
        <mediaMetadata>
          <id>sta00002</id>
          <title>The Cheap Seats</title>
          <mimeType>audio/x-mpegurl </mimeType>
          <itemType>stream</itemType>
          <streamMetadata>
            <currentShow>The New Afternoon Show</currentShow>
          </streamMetadata>
        </mediaMetadata>
        <mediaMetadata>
          <id>sta00003</id>
          <title>Carol Burnett: The 'Fresh Air' Interview</title>
          <mimeType>audio/x-ms-wma</mimeType>
          <itemType>stream</itemType>
          <streamMetadata>
            <currentHost>Terry Gross</currentHost>
              <currentShow>Fresh Air</currentShow>
              <logo>http://example.com/sta00003.png</logo>
          </streamMetadata>
        </mediaMetadata>
      </getMetadataResult>
    </getMetadataResponse>
  </soap:Body>
</soap:Envelope>