Related play

You can add a single custom stream or programmed radio station to the Info View using a related play action. For example, you can provide to your listeners a programmed radio station seeded by a specific artist, album, song, or genre.

The following steps describe how to implement a related play action:

  1. Enable the Extended Metadata for Radio capability. To use the related play action, ensure you enable the Extended Metadata for Radio capability when you submit your service. This indicates that you want to support this capability on all Sonos players that use your service. See Add capabilities and Submit your service for details. See Test your service for details about testing.

  2. When the listener selects the ellipsis (...) to see the Info View, Sonos sends your service a getExtendedMetadata request. This example is for a track item.

       <getExtendedMetadata xmlns="">  
  3. Include all the custom actions for the Info View in your getExtendedMetadata response. To simplify this example we'll show only the related play action.

              <ns:title>Generations of Skipping Heartbeats</ns:title>  
                <ns:artist>The Agrarians</ns:artist>  
                <ns:album>Love Songs from 2011</ns:album>  
            . . . Details for other custom actions in the Info View are not shown . .  
              <ns:title>Radio Blues Program Radio</ns:title>  
  4. For details about the relatedPlay sub-elements, see SMAPI object types.

  5. (Optional) Customize the "Start Radio" text string. The related play displays in the Info View as "Start Radio" by default, but you can replace this text. The following example replaces the text with "Go to Radio".
    In your i18next file, add the following entry. See Localization for details.

        "RELATED_RADIO": "Go to Radio"
  1. If the listener chooses the related play action, the following occurs:

    1. Sonos sends your service a getMetadata request using the given related play id (pradio:2).

    2. Your service would provide the getMetadata response with mediaMetadata for the programmed radio station.

    3. Sonos sends your service a getMediaURI request to get the station URI.

    4. Your service would provide the getMediaURI response with the audio data so that Sonos can begin playing it.


      The Now Playing screen will show the title of the custom radio station. For this example, it would show "Radio Blues Program Radio".