[JavaScript] JS检测浏览器是否支持html5的video标签 →→→→→进入此内容的聊天室

来自 , 2019-12-28, 写在 JavaScript, 查看 130 次.
URL http://www.code666.cn/view/ba7e36c4
  1. // Check if the browser understands the video element.
  2. function understands_video() {
  3.   return !!document.createElement('video').canPlayType; // boolean
  4. }
  5.  
  6. if ( !understands_video() ) {
  7.         // Must be older browser or IE.
  8.         // Maybe do something like hide custom
  9.         // HTML5 controls. Or whatever...
  10.         videoControls.style.display = 'none';
  11. }
  12. //javascript/3899

回复 "JS检测浏览器是否支持html5的video标签"

这儿你可以回复上面这条便签

captcha