关于video 标签的浏览器支持

阅读 2.5k
2 个回答

function showVideo(o,s,w, h, t){ //t文件格式
var _html = '';
if($.inArray(t, ['ogg', 'mp4', 'webm']) >= 0){ //html5 surport
var _doc=document.getElementsByTagName('head')[0];
var script=document.createElement('script');
script.setAttribute('type','text/javascript');
script.setAttribute('src','http://html5media.googlecode....');
_doc.appendChild(script);
script.onload=script.onreadystatechange=function(){
if(!this.readyState||this.readyState=='loaded'||this.readyState=='complete'){
_html = '<video src="'+s+'" width="'+w+'" height="'+h+'" controls autobuffer >';
_html += '</video>';
$(o).css({"width":w+'px', 'height':h+'px', 'cursor':'default'});
$(o).html(_html);
}
script.onload=script.onreadystatechange=null;
}
}else{ //other like 3gp
_html += '<object width="'+w+'" height="'+h+'" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactive...';
_html += '<param name="src" value="'+s+'">';
_html += '<param name="controller" value="true">';
_html += '<param name="type" value="video/quicktime">';
_html += '<param name="autoplay" value="false">';
_html += '<param name="target" value="myself">';
_html += '<param name="bgcolor" value="black">';
_html += '<param name="pluginspage" value="http://www.apple.com/quicktim...';
_html += '<embed src="'+s+'" width="'+w+'" height="'+h+'" controller="true" autoplay="false" align="middle" bgcolor="black" target="myself" type="video/quicktime" pluginspage="http://www.apple.com/quicktim...';
_html += '</object>';
$(o).css({"width":w+'px', 'height':h+'px', 'cursor':'default'});
$(o).html(_html);
}
}

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏