0

动态嵌入 HTML5 视频以使其在 iPad 上运行的正确方法是什么?(使用纯 Javascript)

这不起作用:

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

这是 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>');

谢谢!

4

1 回答 1

0

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

于 2013-05-05T20:14:15.273 回答