代码验证浏览器是否支持html audio 和video
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> <meta charset="utf-8" /> <script type="text/javascript" > function load() { var video = document.createElement("video"); if(typeof(video.canPlayType)) { alert("你的浏览器支持html5 audio and video"); } else { alert("sorry,你的浏览器不支持html5 audio and video") } } window.addEventListener("load", load, false); </script> </head>
转载时请注明出处!