I do not have a spotify account and you do not plan to create it, but the next solution should work, you just need to conduct a little investigation.
Spotify iFrame has a click event attached to .play-pause-btn (I think). To start, you must activate the click event to play. It will be something like this:
$("#musicbox").contents().find("div.play-pause-btn").click();
Adding it with the rest of your code:
$('#partystart').toggle(function () { $(".fadeIn").addClass("party"); $("#musicbox").slideDown("300"); $("#partystart").html("<a id='partystart'>Take a break</a>"); $("#musicbox").contents().find("div.play-pause-btn").click(); }, function () { $(".fadeIn").removeClass("party"); $(".fadeIn").addClass("fullopacity"); $("#musicbox").slideUp("300"); $("#partystart").html("<a id='partystart'>▲ Rock the house!</a>"); }); });
If this does not work, you need to determine which element has a click event on it.
source share