我们正在尝试构建一个API来在Sonos上播放有声读物,并且我们遇到了这样的问题:通过轨道寻找似乎是专门禁用有声本类型容器的。当我们将容器类型设置为‘容器’时,我们注意到了这个问题,发现不仅是在寻找可能的轨道,而且“快速跳”(Quick)也是可能的,这应该只适合有声本和播客(https://developer.sonos.com/build/content-service-get-started/supported-audio-content/)。
当本章的容器类型被设置为“audiobook”时,下面是回放的样子,以及当容器类型被设置为“容器”时,下面是它的样子。为什么我们会遇到这个问题,有没有办法允许在有声书容器内的轨道中寻找和快速跳过?
下面是来自我们服务的getMetadata响应示例。
根:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<getMetadataResponse xmlns="http://www.sonos.com/Services/1.1">
<getMetadataResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<index>0</index>
<count>1</count>
<total>1</total>
<mediaCollection>
<id>audiobook:33462:2617184</id>
<itemType>container</itemType>
<title>The Grapes of Wrath</title>
<summary>First published in 1939, The Grapes of Wrath creates an unforgettable portrait of the migrants who left the dust bowl for the promised land of California. Although he wrote it quickly, Steinbeck spent much time gathering detailed reports of the desperate conditions in migrant camps. He also worked in one camp helping to care for its starving residents. Although they have planted the land for generations, the Joads are tenant farmers. Now drought and mechanization have forced them off the Oklahoma farm they call home. As they travel toward new jobs in California, the penniless, hungry Joads learn that America has no mercy for the poor. Their fate is one that was repeated in hundreds of lives. Brilliant in its fusion of drama and rhetoric, The Grapes of Wrath changed the way the world saw migrant workers. They would never again be faceless masses who could be ignored and abandoned. This landmark work's impact earned John Steinbeck the Pulitzer Prize and contributed...</summary>
<author>John Steinbeck</author>
<narrator>Dylan Baker</narrator>
<canPlay>true</canPlay>
<albumArtURI>https://img1.od-cdn.com/ImageType-150/1694-1/5CE/FF2/0E/{5CEFF20E-0C05-4FA1-8903-34D26124FC29}Img150.jpg</albumArtURI>
<canResume>true</canResume>
</mediaCollection>
</getMetadataResult>
</getMetadataResponse>
</s:Body>
</s:Envelope>标题:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<getMetadataResponse xmlns="http://www.sonos.com/Services/1.1">
<getMetadataResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<index>0</index>
<count>20</count>
<total>20</total>
<mediaMetadata>
<id>navEl:33462:2617184:0:0</id>
<itemType>track</itemType>
<title>The Grapes of Wrath [0/20]</title>
<mimeType>audio/mpeg</mimeType>
<trackMetadata>
<author>John Steinbeck</author>
<narrator>Dylan Baker</narrator>
<albumArtURI>https://....Img150.jpg</albumArtURI>
<canPlay>true</canPlay>
<canAddToFavorites>false</canAddToFavorites>
</trackMetadata>
</mediaMetadata>
<mediaMetadata>
<id>navEl:33462:2617184:1:0</id>
<itemType>track</itemType>
<title>The Grapes of Wrath [1/20]</title>
<mimeType>audio/mpeg</mimeType>
<trackMetadata>
<author>John Steinbeck</author>
<narrator>Dylan Baker</narrator>
<albumArtURI>https://img1.od-cdn.com/ImageType-150/1694-1/5CE/FF2/0E/{5CEFF20E-0C05-4FA1-8903-34D26124FC29}Img150.jpg</albumArtURI>
<canPlay>true</canPlay>
<canAddToFavorites>false</canAddToFavorites>
</trackMetadata>
</mediaMetadata>
<mediaMetadata>
<id>navEl:33462:2617184:2:0</id>
<itemType>track</itemType>
<title>The Grapes of Wrath [2/20]</title>
<mimeType>audio/mpeg</mimeType>
<trackMetadata>
<author>John Steinbeck</author>
<narrator>Dylan Baker</narrator>
<albumArtURI>https://.....Img150.jpg</albumArtURI>
<canPlay>true</canPlay>
<canAddToFavorites>false</canAddToFavorites>
</trackMetadata>
</mediaMetadata>
<!--More MediaMetadata Elements-->
</getMetadataResult>
</getMetadataResponse>
</s:Body>
</s:Envelope>是否有任何额外的参数,我们必须包括,以使寻找工作的有声书籍?
发布于 2019-07-30 14:04:21
看起来您缺少了duration元素在trackMetadata中。为通用container itemType显示Quick按钮的事实是意外的。
只要元数据包含作者、叙述者或章节标题,Sonos应用程序就会显示用于有声读物的快速跳转,前提是:
audioBook指定为itemType。trackMetadata中为每一章包括trackMetadata。详情请参见保存和恢复播放位置。
https://stackoverflow.com/questions/57259211
复制相似问题