The question was whether or not this is possible and the answer is that it is. To Math's point, there are additional design considerations. The full solution would require a tracking variable toggled at course start to indicate a user has entered the course. The state of the variable can easily be checked at slide start using an action on a master slide. If the variable meets a condition, show a layer that asks an additional question on resume ... something like "Would you like to continue with the music on or off". Based on the selection, run the JavaScript to add the player and start the music. What I like about this is that it both satisfies the browser requirement for interaction, it also gives the participant a choice in the matter of music. It treats them like adults.
You could also use JavaScript to check by ID if the player element exists since you are assigning it an ID when creating it. Then if it doesn't exist, adding the JavaScript to run at slide start. The user would have interacted with the page already (having clicked the resume button) and you start the music. The point is, there are multiple ways to do this and no single best answer. That is left up to the designer to figure out HOW they want to do it. But again, the question was CAN it be done.
I will add that I'm concerned by the trend I am seeing of more and more negative critiques of responses on this forum. More often than not, most forum members are offering [free] advice and knowledge but not necessarily solving a person's complete issue for them. The forum isn't a place to just jump in and say "that won't work". If you don't like a response, offer the solution instead of just a critique. But maybe that is just my opinion?