How to: Query different PlaybackItem
types to explore their properties and behaviour
-
AudioAdItem
To trigger audio ads, you would need to pass through the
testMode
parameter to thesetSource
mutation. Once you've set the source, you can callsetEnded
a few times to until you trigger anAudioAdItem
. Note that these queries should be run using a Tier 1 listener account.mutation { playback { setSource(deviceUuid: "deviceXYZ", sourceId: "SF:16722:306247", testMode: "audio") { current { sourceId interactions ... on AudioAdItem { audioUrl adCompanyName adTitle duration interactions } ... on TrackItem { track { id name duration artist { name } } } } } } }
mutation { playback { setEnded(deviceUuid:"deviceXYZ", sourceId:"ST:0:68350521875800649", index: 67, elapsedTime: 200, reason: NORMAL) { status current { index sourceId interactions ... on AudioAdItem { audioUrl adCompanyName adTitle duration interactions } ... on TrackItem { track { id name duration artist { name } } } } } } }
-
PodcastEpisodeItem
mutation { playback { setSource(deviceUuid: "deviceXYZ", sourceId: "PE:122773") { current { ... on PodcastEpisodeItem { podcastEpisode { name duration art { url } podcast { name totalEpisodeCount } } } } } } }
{ "data": { "playback": { "setSource": { "current": { "podcastEpisode": { "name": "S03 Episode 02: You’ve Got Some Gauls", "duration": 3298, "art": { "url": "http://content-images.p-cdn.com/images/e6/be/a1/23/104a492c9cc8e3a6cc3d6b56/_500W_500H.jpg" }, "podcast": { "name": "Serial", "totalEpisodeCount": 36 } } } } } } }
-
TrackItem
mutation { playback { setSource(deviceUuid: "deviceXYZ", sourceId: "TR:1021783") { current { ... on TrackItem { track { name duration artist { name } album { name } } } } } } }
{ "data": { "playback": { "setSource": { "current": { "track": { "name": "Baby Got Back", "duration": 262, "artist": { "name": "Sir Mix-A-Lot" }, "album": { "name": "Mack Daddy (Explicit)" } } } } } } }