fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <p>浏览器是否支持播放 MP4 视频? <span> <button onclick="supportType(event,'video/mp4','avc1.42E01E, mp4a.40.2')" type="button">测试</button> </span></p> <p>浏览器是否支持播放 OGG 视频? <span> <button onclick="supportType(event,'video/ogg','theora, vorbis')" 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>
运行结果