Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

369
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda