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

231
Vistas
youtube player api: Uncaught TypeError: a.next is not a function when loading script from www.youtube.com/iframe_api

the following problem: I load the player api as described here: https://developers.google.com/youtube/iframe_api_reference#Getting_Started

Then i get this error message: enter image description here

I get this error only on some domains. On other domains, it works fine. With the same video and the same iframe snippet.

unfortunately when this error occurs this callback function is never executed: onYouTubeIframeAPIReady

This is the main issue here.

If i wait a couple of seconds and execute the snippet manually:

  var tag = document.createElement('script');

  tag.src = "https://www.youtube.com/iframe_api";
  var firstScriptTag = document.getElementsByTagName('script')[0];
  firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

the error message does not appear. But onYouTubeIframeAPIReady is still not executed.

So it must be some kind of timing issue. But the problem never occurred to me before. Any hints on what might be the reason for that or easy workarounds would be appreciated.

Unfortunately, I am not allowed to share the affected domains.

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