Video 对象方法 canPlayType()
生活随笔
收集整理的這篇文章主要介紹了
Video 对象方法 canPlayType()
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鳥教程(runoob.com)</title> </head> <body> <p>我的瀏覽器可以播放 MP4 視頻嗎?<span> <button οnclick="supportType(event,'video/mp4','avc1.42E01E, mp4a.40.2')" type="button">測試</button> </span></p><p>我的瀏覽器可以播放 OGG 視頻嗎?<span> <button οnclick="supportType(event,'video/ogg','theora, vorbis')" type="button">測試</button> </span></p><script> function supportType(e,vidType,codType) { myVid=document.createElement('video');isSupp=myVid.canPlayType(vidType+';codecs="'+codType+'"');if (isSupp==""){isSupp="No";}e.target.parentNode.innerHTML="Answer: " + isSupp; } </script> </body> </html>?
轉載于:https://www.cnblogs.com/sea-stream/p/10551469.html
總結
以上是生活随笔為你收集整理的Video 对象方法 canPlayType()的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 苹果推出全新 Today at Appl
- 下一篇: django之auth模块