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

101
Vistas
Html video shows white screen when added dynamically using ajax

Using jQuery, I'm sending an AJAX request that will send back JSON data with HTML code. The html code will then be appended to the document's body. Here is what I'm doing:

$.get('get.php', { req: 'video_html' }, function (data) {

    if (data.responsetype === "SUCCESS") {

        $(document.body).append(data.video_html);
    }
});

The video_html code is as following:

<video id="newVideo" src="http://.... .mp4" preload="yes">
    Your browser does not support video playing.
</video>

The video is added to the document body successfully, the URL (src attribute) is also linked properly to the video but it shows a white screen instead. Anyone knows why?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I added a timeout and it worked:

$.get('get.php', { req: 'video_html' }, function (data) {

    setTimeout(function(){

        if (data.responsetype === "SUCCESS") {

            $(document.body).append(data.video_html);
        }

    }, 1000);
});
about 4 years ago · Santiago Trujillo Denunciar
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