Say, for example that I want to display a video with HTML5’s
<video> tag, but I need to detect wether my browser supports MP4 or Theora.Ogg. You can do it easily with the
canPlayType() method. You can simple create a new media element and then use the canPlayType to check for the proper format support.