我想知道如何使用 jquery 或 javascript 将对象标签添加到 html5 视频标签
我通过 jquery 尝试但不成功(无法在 IE8 及以下浏览器中查看视频)
以下是我的代码
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var configval= "config={'playlist':['http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg',{'url':'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4','autoPlay':false}]}";
var $source = $('<object type="application/x-shockwave-flash" width="640" height="360">'+
'<param name="movie" value="http://api.html5media.info/1.1.5/flowplayer.swf" />'+
'<param name="flashVars" value="1" />'+
'</object>'+
'<p>need to install quick time player to play videos</p>');
$source.find('param[name="flashVars"]').attr('value', configval);
var $video = $('<video controls="controls" poster="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg" width="640" height="360"></video>').append($source);
$('body').append($video);
})
</script>