在为有声读物禁用的曲目中寻找
Seeking Within Tracks Disabled for Audiobooks
我们正在尝试构建一个 API 来在 Sonos 上播放有声读物,我们已经 运行 解决了一个问题,即对于有声读物类型的容器,似乎专门禁用了通过曲目进行搜索的问题。当我们将容器类型设置为 'container' 时,我们注意到了这个问题,发现不仅可以在轨道周围搜索,而且 "Quick Skips," 也可以,这应该只适用于有声读物和播客(https://developer.sonos.com/build/content-service-get-started/supported-audio-content/).
Here is what playback looks like when the container type for our chapter tracks is set to 'audiobook' and here's what it looks like 当容器类型设置为 'container.' 为什么我们要 运行 解决这个问题,有什么方法可以允许在轨道内搜索和快速跳过有声读物容器中的曲目?
以下是我们服务的 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>
为了有声读物的搜索工作,我们是否必须包含任何其他参数?
您似乎缺少 trackMetadata
中的 duration
元素。为通用 container
itemType
显示快速跳过按钮的事实是无意的。
当元数据包含作者、旁白或章节标题时,Sonos 应用程序会显示有声读物的快速跳过,前提是您:
- 将
audioBook
指定为 itemType
。
- 在每个章节的
trackMetadata
中包含 duration
。
我们正在尝试构建一个 API 来在 Sonos 上播放有声读物,我们已经 运行 解决了一个问题,即对于有声读物类型的容器,似乎专门禁用了通过曲目进行搜索的问题。当我们将容器类型设置为 'container' 时,我们注意到了这个问题,发现不仅可以在轨道周围搜索,而且 "Quick Skips," 也可以,这应该只适用于有声读物和播客(https://developer.sonos.com/build/content-service-get-started/supported-audio-content/).
Here is what playback looks like when the container type for our chapter tracks is set to 'audiobook' and here's what it looks like 当容器类型设置为 'container.' 为什么我们要 运行 解决这个问题,有什么方法可以允许在轨道内搜索和快速跳过有声读物容器中的曲目?
以下是我们服务的 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>
为了有声读物的搜索工作,我们是否必须包含任何其他参数?
您似乎缺少 trackMetadata
中的 duration
元素。为通用 container
itemType
显示快速跳过按钮的事实是无意的。
当元数据包含作者、旁白或章节标题时,Sonos 应用程序会显示有声读物的快速跳过,前提是您:
- 将
audioBook
指定为itemType
。 - 在每个章节的
trackMetadata
中包含duration
。