直接在低版本IE6/7/8浏览器中使用HTML5的audio和video标签播放视频音频的办法

时间:2022-05-19 09:24:11

代码如下:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<title>演示页面</title>
<script src="http://api.html5media.info/1.1.5/html5media.min.js"></script>
<style>
body{background-color:#000;}
</style>
</head>
<body>

<p><video width="960" height="600" poster="images/index_pic.png" autoplay=true controls preload>
<source src="vedio/guangyu.mp4" ></source>
</video></p>
</body>
</html>

 不能正常播放时,需注意以下几点:

1.html5media.min.js必须连接远程地址,http://api.html5media.info/1.1.5/html5media.min.js,下载本地连接不行,问题还在研究中。

2.必须放在服务器上才能正常浏览,如iis, 前提:iis一定要配置 扩展名为.mp4的MIME,类型为:video/mpeg