<html>
<body>
<p>我的浏览器可以播放 MP4 视频吗?
<span>
<button onclick="supportType(event,'video/mp4','avc1.42E01E, mp4a.40.2')" type="button">测试</button>
</span>
</p>
<script>
function supportType(e,vidType,codType) {
var x = document.createElement("VIDEO");
isSupp = x.canPlayType(vidType+';codecs="'+codType+'"');
if (isSupp == "") {
isSupp = "No";
}
e.target.parentNode.innerHTML = "答案:" + isSupp;
}
</script>
</body>
</html>