Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Please see below the most popular frequently asked questions.
Loading article...
Loading faqs...
Please see below the current ongoing issues which are under investigation.
Loading issue...
Loading ongoing issues...
Is there a way to set the player color to black with iFrame API? If we embed manually, there is the option to use the black background color when creating the embed code. It adds &theme=0 to the podcast URL.
I am not finding a way to achieve the same using the Iframe API.
Thanks!
Solved! Go to Solution.
Hi veronicabend,
I'm an engineer working in the team that owns the Iframe API. We have added the option `theme` that can be set to `dark` in order to load the dark variant of the embed player using the Iframe API.
window.onSpotifyIframeApiReady = (IFrameAPI) => {
let element = document.getElementById('embed-iframe');
let options = {
uri: 'spotify:episode:7makk4oTQel546B0PZlDM5',
theme: 'dark'
};
let callback = (EmbedController) => {};
IFrameAPI.createController(element, options, callback);
};
Thank you for reaching out to us. Hope this helps 🙂
I think you can find the answer on this page:
https://developer.spotify.com/documentation/embeds/tutorials/using-the-iframe-api
Thank you, I have already looked in that page, but there is no explanation there on how to change the player background color. It only mentions changing the width and height.
A howlin' hello to you veronicabend!
Yes, you can set the player color to black using the Spotify Player SDK and the iFrame API. To achieve this, you can pass the theme parameter in the Spotify Player SDK initialization code. Here's an example of how you can do it:
// Initialize the Spotify Player SDK
const player = new Spotify.Player({
name: 'Your Player Name',
getOAuthToken: callback => {
// Implement your logic to retrieve the user's access token here
// Call the callback function with the access token
callback('YOUR_ACCESS_TOKEN');
},
theme: 'black' // Set the player theme to black
});
// Connect to the player
player.connect().then(success => {
if (success) {
console.log('The player is connected!');
}
}).catch(error => {
console.error('Error connecting to the player:', error);
});
By setting the theme parameter to 'black', you can achieve a black player background color using the Spotify Player SDK and the iFrame API.
Sending 'fur-bulous' vibes and I hope that I've been helpful,
-Prague the Dog
In the code at the bottom of the page, you can see two times "background:".
Yes I see background two times, but that is CSS to set background of the "Episode" buttons that the example adds on the left. I need to change the background of the player itself.
Hi Prague, thank you, but I am not using that SDK, I am using the Iframe API. There is no Oauth token there, the code is different:
window.onSpotifyIframeApiReady = (IFrameAPI) => {
const element = document.getElementById('embed-iframe');
const options = {
uri: 'spotify:episode:7makk4oTQel546B0PZlDM5'
};
const callback = (EmbedController) => {};
IFrameAPI.createController(element, options, callback);
};
I think the Options parameter would need to allow for setting "theme=0" as when you embed manually, but I have not seen that in documentation. I saw that the possible options are the uri, the width and height of the player.
Thanks.
Hi veronicabend,
I'm an engineer working in the team that owns the Iframe API. We have added the option `theme` that can be set to `dark` in order to load the dark variant of the embed player using the Iframe API.
window.onSpotifyIframeApiReady = (IFrameAPI) => {
let element = document.getElementById('embed-iframe');
let options = {
uri: 'spotify:episode:7makk4oTQel546B0PZlDM5',
theme: 'dark'
};
let callback = (EmbedController) => {};
IFrameAPI.createController(element, options, callback);
};
Thank you for reaching out to us. Hope this helps 🙂
Thank you! It worked perfectly.
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…