Get started with videojs-contrib-dash CDN

Apache-2.0 licensed

Video.js Contrib Dash: Plugin enabling DASH streaming in Video.js.

Tags:
  • video.js
  • dash.js
  • widevine
  • playready
  • dash
  • MPEG-DASH

Stable version

Copied!

How to start using videojs-contrib-dash CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with videojs-contrib-dash CDN - cdnhub.io</title>
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/video-js.min.css" rel="stylesheet" />
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/video.min.js"></script>
  <script src="https://cdn.cdnhub.io/videojs-contrib-dash/5.1.1/videojs-dash.min.js"></script>
</head>
<body>
  <div id="my-video" class="video-container">
    <video id="video" class="video-js" controls preload="auto" width="640" height="360" data-dashjs-player>
      <source src="https://example.com/path/to/your/manifest.mpd" type="application/dash+xml">
    </video>
  </div>

  <script>
    if (document.readyState === 'interactive') {
      initPlayer();
    } else {
      document.addEventListener('DOMContentLoaded', initPlayer);
    }

    function initPlayer() {
      const player = videojs('video');
      player.dash.source().then(function(source) {
        source.on('dashmanifestloaded', function() {
          player.play();
        });
      });
    }
  </script>
</body>
</html>
Copied!
Copied!

All versions