videojs-hls.js

0.0.1 • Public • Published

video.js HLS Source Handler

Adds HLS playback support to video.js 5.0+ using Dailymotion's hls.js library.

Installation

Use Grunt to build vjs-hls.js from the sources.

Use grunt buildto build the dist scripts.

Usage

Include video.js and vjs-hls.js in your page:

<head>
    <link href="http://vjs.zencdn.net/5.0/video-js.min.css" rel="stylesheet">
    <script src="http://vjs.zencdn.net/5.0/video.min.js"></script>
    <script src="vjs-hls.js"></script>
</head>

<body>
    <video id=example-video width=600 height=300 class="video-js vjs-default-skin" controls>
        <source src="http://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8" type="application/x-mpegURL">
    </video>
    <script>
        var player = videojs('example-video');
    </script>
</script>
</body>
</html>

There are several ways of getting video.js files, you can read about them in official documentation and choose the one that match your needs best.

Passing configuration options to hls.js

Define hlsjsConfig property in html5 field of video.js options object and pass it as second param to videojs constructor. List of available hls.js options is here:

<script>
    var options = {
        html5: {
            hlsjsConfig: {
                debug: true
            }
        }
    };
    var player = videojs('example-video', options);
</script>

Readme

Keywords

none

Package Sidebar

Install

npm i videojs-hls.js

Weekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • axeld