Documentation

How to: Query different PlaybackSource types to explore their properties and behaviour 

  • AlbumSource

    If you set an album for playback and at any point retrieve the current playback source, it would be of this type.

    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "AL:1110124") {
          current {
            ... on TrackItem {
            	track {
                name
                artist {
                  name
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      playback {
        source(deviceUuid: "deviceXYZ") {
          ... on AlbumSource {
            album {
              name
              artist {
                name
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "source": {
            "album": {
              "name": "1989",
              "artist": {
                "name": "Taylor Swift"
              }
            }
          }
        }
      }
    }
    
    
  • ArtistPlaySource

    Query an artist to get the artistPlay id

    
    
    query {
      entity(id: "AR:188587") {
        __typename
        id
        ... on Artist {
          name
          artistPlay {
            id
            name
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "entity": {
          "__typename": "Artist",
          "id": "AR:188587",
          "name": "Taylor Swift",
          "artistPlay": {
            "id": "AP:16722:188587",
            "name": "Artist Play"
          }
        }
      }
    }
    
    
    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "AP:16722:188587") {
          current {
            ... on TrackItem {
            	track {
                name
                artist {
                  name
                }
              }
            }
          }
          ... on ArtistPlaySource {
            id
            shuffle
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "setSource": {
            "current": {
              "track": {
                "name": "Blank Space",
                "artist": {
                  "name": "Taylor Swift"
                }
              }
            },
            "id": "AP:16722:188587",
            "shuffle": false
          }
        }
      }
    }
    
    
  • ArtistTracksSource

    Query an artist to get the artistTracksPlay id

    
    
    query {
      entity(id: "AR:188587") {
        __typename
        id
        ... on Artist {
          name
          artistTracksPlay {
            id
            name
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "entity": {
          "__typename": "Artist",
          "id": "AR:188587",
          "name": "Taylor Swift",
          "artistTracksPlay": {
            "id": "AT:16722:188587",
            "name": "Artist Tracks Play"
          }
        }
      }
    }
    
    
    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "AT:16722:188587") {
          current {
            ... on TrackItem {
            	track {
                name
                artist {
                  name
                }
              }
            }
          }
          ... on ArtistTracksSource {
            id
            shuffle
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "setSource": {
            "current": {
              "track": {
                "name": "Blank Space",
                "artist": {
                  "name": "Taylor Swift"
                }
              }
            },
            "id": "AT:16722:188587",
            "shuffle": false
          }
        }
      }
    }
    
    
  • AutoPlayPodcastSource

    Set a podcast episode (PE) as the playback item. The playback source should be a podcast (PC). When you perform a skip, and autoplay is enabled, the playback source would change to an autoplay podcast source.

    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "PE:3409264") {
          current {
            sourceId
            interactions
            ... on PodcastEpisodeItem {
              podcastEpisode {
                id
                name
                duration
                podcast {
                  name
                  summary
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "setSource": {
            "current": {
              "sourceId": "PC:28532",
              "interactions": [
                "THUMB",
                "BACK_15_SECONDS",
                "FORWARD_15_SECONDS",
                "SEEK"
              ],
              "podcastEpisode": {
                "id": "PE:3409264",
                "name": "Spent-ology 101",
                "duration": 2061,
                "podcast": {
                  "name": "ClearView Church Shreveport",
                  "summary": "Audio podcasts from John Hawkins, lead minister of ClearView Church in Shreveport, LA. ClearView: a family sharing God's grace, living for others, and experiencing transformation. www.clearviewshreveport.org"
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    mutation {
      playback {
        setEnded(deviceUuid:"deviceXYZ", sourceId:"PC:28532", elapsedTime: 100, index: 0) {
          status
          current {
            sourceId
            __typename
            ... on PodcastEpisodeItem {
              podcastEpisode {
                id
                name
                duration
                podcast {
                  name
                  summary
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "setEnded": {
            "status": "OK",
            "current": {
              "sourceId": "PA:20549:3409290",
              "__typename": "PodcastEpisodeItem",
              "podcastEpisode": {
                "id": "PE:3409290",
                "name": "At the End of Ourselves",
                "duration": 2174,
                "podcast": {
                  "name": "ClearView Church Shreveport",
                  "summary": "Audio podcasts from John Hawkins, lead minister of ClearView Church in Shreveport, LA. ClearView: a family sharing God's grace, living for others, and experiencing transformation. www.clearviewshreveport.org"
                }
              }
            }
          }
        }
      }
    }
    
    
  • AutoPlaySource

    Set a track as the playback source and then perform a skip.  If autoplay is enabled, the playback source will default to an autoplay source.

    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "TR:2188679") {
          __typename
          id
          current {
            index
            ... on TrackItem {
              track {
                id
                name
                artist {
                  name
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "setSource": {
            "__typename": "TrackSource",
            "id": "TR:2188679",
            "current": {
              "index": 0,
              "track": {
                "id": "TR:2188679",
                "name": "Hey, Hey, Hey",
                "artist": {
                  "name": "LoCash Cowboys"
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    mutation {
      playback {
        skip(deviceUuid:"deviceXYZ", sourceId:"TR:2188679", index:0, elapsedTime:10) {
          source {
            __typename
            id
          }
          current {
            ... on TrackItem {
              track {
                id
                name
                artist {
                  name
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "skip": {
            "source": {
              "__typename": "AutoPlaySource",
              "id": "AU:21586:2188679"
            },
            "current": {
              "track": {
                "id": "TR:2225018",
                "name": "Independent Trucker",
                "artist": {
                  "name": "LoCash Cowboys"
                }
              }
            }
          }
        }
      }
    }
    
    
  • PodcastProgramSource
    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "PC:2") {
          current {
            ... on PodcastEpisodeItem {
            	podcastEpisode {
                id
                name
              }
            }
          }
          ... on PodcastProgramSource {
            id
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "setSource": {
            "current": {
              "podcastEpisode": {
                "id": "PE:122775",
                "name": "S03 Trailer"
              }
            },
            "id": "PC:2"
          }
        }
      }
    }
    
    
  • PlaylistSource
    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "PL:1970324894891522:1281140843") {
          current {
            ... on TrackItem {
            	track {
                name
                artist {
                  name
                }
              }
            }
          }
          ... on PlaylistSource {
            id
            playlist {
              name
              owner {
                fullname
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "setSource": {
            "current": {
              "track": {
                "name": "...Baby One More Time",
                "artist": {
                  "name": "Britney Spears"
                }
              }
            },
            "id": "PL:1970324894891522:1281140843",
            "playlist": {
              "name": "90s Hits",
              "owner": {
                "fullname": "Legacy"
              }
            }
          }
        }
      }
    }
    
    
  • StationSource
    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "SF:18245:32") {
          current {
            ... on TrackItem {
            	track {
                name
                artist {
                  name
                }
              }
            }
          }
          ... on StationSource {
            id
            station {
              name
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "setSource": {
            "current": {
              "track": {
                "name": "We Will Rock You (Remastered 2011)",
                "artist": {
                  "name": "Queen"
                }
              }
            },
            "id": "ST:0:4460730898612606103",
            "station": {
              "name": "Classic Rock Radio"
            }
          }
        }
      }
    }
    
    
  • TrackSource
    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "TR:13419229") {
          current {
            ... on TrackItem {
            	track {
                name
                artist {
                  name
                }
              }
            }
          }
          ... on TrackSource {
            id
            track {
              name
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "setSource": {
            "current": {
              "track": {
                "name": "Y.M.C.A. (Single Version)",
                "artist": {
                  "name": "The Village People"
                }
              }
            },
            "id": "TR:13419229",
            "track": {
              "name": "Y.M.C.A. (Single Version)"
            }
          }
        }
      }
    }