Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

373
Views
Spotify iFrame API's `play()` and `togglePlay()` methods not working

Spotify iFrame API has two play state management methods. These are play() and togglePlay(). I want to after the listen any trigger, initialize and play automatically the player. But these methods not working. (destory() method working correctly.)

My code snippet:

<script src="https://open.spotify.com/embed-podcast/iframe-api/v1" async></script>
<div id="embed-iframe"></div>
<script>
  window.onSpotifyIframeApiReady = (IFrameAPI) => {
    let element = document.getElementById('embed-iframe');
    let options = {
      uri: 'spotify:episode:7makk4oTQel546B0PZlDM5'
    };
    let callback = (EmbedController) => {
      document.addEventListener('click', () => {
        EmbedController.play();
      });

    };
    IFrameAPI.createController(element, options, callback);
  };
</script>

The snippet was render a spotify player. But my click listener is run and EmbedController.play(); not work.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!