JS detects whether the browser supports the video tag of HTML5

From , 3 Years ago, written in JavaScript, viewed 88 times.
URL https://pastebin.vip/view/8fdd149f
  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

Reply to "JS detects whether the browser supports the video tag of HTML5"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website