Skip to content

Instantly share code, notes, and snippets.

@ErikAndreas
Created December 7, 2011 12:07
Show Gist options
  • Save ErikAndreas/1442575 to your computer and use it in GitHub Desktop.
Save ErikAndreas/1442575 to your computer and use it in GitHub Desktop.
Spotify Apps Api - Tabs
<script type="text/javascript">
function init() {
console.log("init()");
sp = getSpotifyApi(1);
// detects arguments value for tab
sp.core.addEventListener("argumentsChanged", function (event) {
console.log('args changed', sp.core.getArguments());
});
}
</script>
{
"DefaultTabs": [
{
"arguments": "tab1",
"title": {
"en": "title tab 1"
}
},
{
"arguments": "tab2",
"title": {
"en": "title tab 2"
}
}
]
}
@ErikAndreas
Copy link
Author

Yepp, it runs. However, any error in manifest file will cause strange behavior - always validate it.

@seanschumer
Copy link

Ah got it to work. I think Spotify just needed a reboot. Thanks.

@Svanmark
Copy link

Is there any way to do a drop down sub-menu for a certain tab?

@seanschumer
Copy link

I don't think that is an option. We Are Hunted uses a drop down menu but they actually aren't using the Spotify bar. They redid the bar themselves and you can actually pull it from them if you inspect their app.

@Svanmark
Copy link

Thanks man. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment