Get started with videojs-background CDN

MIT licensed

Video.js plugin: Background videos with aspect ratio and opacity control.

Tags:
  • videojs
  • html5
  • flash
  • video
  • player
  • background

Stable version

Copied!

How to start using videojs-background CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with videojs-background CDN - cdnhub.io</title>
  <link href="https://cdn.jsdelivr.net/npm/video.js@7.11.4/dist/video-js.min.css" rel="stylesheet">
  <script src="https://cdn.jsdelivr.net/npm/video.js@7.11.4/dist/video.min.js"></script>
  <script src="https://cdn.cdnhub.io/videojs-background/1.0.7/videojs-background.min.js"></script>
</head>
<body>
  <video id="my-video" class="video-js" controls preload="auto" width="100%" height="100%" poster="poster.jpg" data-setup='{"techOrder": ["background"]}'>
    <source src="movie.mp4" type="video/mp4">
  </video>

  <script>
    const player = videojs('my-video');
    player.background({
      src: 'background.jpg' // Replace with the path to your background image
    });
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!

All versions