There are hundreds of polyfills and shims already developed. And this list grows as soon as a new feature, element, or enhancement is created.
We will see some polyfill implementations right now, but it is important that you check the website https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills, checking if there is a polyfill already developed before you start creating a new one.
MediaElements is a polyfill that creates a consistency of player designs for the <video>
and <audio>
elements being viewed in older browsers, using Flash technology that mimics the native HTML5 MediaElement API.
In the following example, we will apply this library to improve the browser's consistency when displaying videos. However, there is still a lot of work to get every browser to play your audio/video because they require hosting multiple versions of the file in different formats such as .mp4
, .webm
, and .ogg
.