Get started with videojs-contrib-hls CDN

Apache-2.0 licensed

Video.js Contrib HLS is a plugin for the Video.js library that enables HLS support.

Tags:
  • videojs
  • videojs-plugin
  • hls
  • streaming

Stable version

Copied!

How to start using videojs-contrib-hls CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with videojs-contrib-hls 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-hls/5.15.0/videojs-contrib-hls.min.js"></script>
</head>
<body>
    <video id="my-video" class="video-js" controls preload="auto" width="640" height="360" data-setup='{"techOrder": ["hls"]}'>
        <source src="https://example.com/path/to/your/hls/manifest.m3u8" type="application/x-mpegURL">
    </video>

    <script>
        if (document.readyState === 'loading') {
            document.addEventListener('DOMContentLoaded', () => {
                const player = videojs('my-video');
            });
        } else {
            const player = videojs('my-video');
        }
    </script>
</body>
</html>
Copied!
Copied!

All versions