Incruste dinámicamente video HTML5 para iPad

What is the correct way to embed HTML5 video dynamically so it works on the iPad? (with plain Javascript)

Esto no funciona:

<div id="placeholder"><script type="text/javascript" src="embedvideo.js"></script></div>

Here's the code for embedvideo.js:

var div = document.getElementById('placeholder');
div.insertAdjacentHTML('beforeend', '<video width="800" height="450" poster="image.jpg" controls><source src="video.mp4" type="video/mp4"></video>');


preguntado el 05 de mayo de 13 a las 15:05

1 Respuestas

Nowhere are you calling the function. So you need to include the script in the head and call the function to insert it.

contestado el 05 de mayo de 13 a las 21:05

I see, the only thing I can think of then is the codec for your video. is there an example I can see? - patatas fritas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.