How to determine whether the current browser supports html5 video tags, html5video
How to determine whether the current browser supports html5 video tags:
Html5 adds the video tag, which is used to play videos. It is very powerful, but many Browsers Do not currently support it. Therefore, you need to determine whether the current browser supports this tag when using it, the following is a piece of code that can implement this function, hoping to help friends who need it.
The Code is as follows:
// Check whether HTML5function checkVideo () {if (!! Document. createElement ('video '). canPlayType) {var vidTest = document. createElement ("video"); oggTest = vidTest. canPlayType ('video/ogg; codecs = "theora, vorbis" '); if (! OggTest) {hsf-test = vidTest. canPlayType ('video/mp4; codecs = "avc1.42E01E, mp4a. 40.2" '); if (! Hsf-test) {return false;} else {if (hsf-test = "probably") {return true;} else {return false ;}}} else {if (oggTest = "probably") {return true;} else {return false ;}}
Original address: http://www.51texiao.cn/HTML5jiaocheng/2015/0612/4011.html
Most original address: http://www.softwhy.com