video-fit-polyfill

An object-fit polyfill for videos.

Usage no npm install needed!

<script type="module">
  import videoFitPolyfill from 'https://cdn.skypack.dev/video-fit-polyfill';
</script>

README

Video-fit Polyfill

An object-fit polyfill for videos.

Instalation

Use npm install video-fit-polyfill

Usage

For magic:

  1. import it
  2. use *fit-video as class in all the videos you want.
  3. Magic

If you prefer use your own selector, import the function and added as below.

videoFitPolyfill('.mi-custom-selector')

If the browser supports object-fit it won't do anything.