Lumen help

Integrating Mesh Delivery with Hls.js


Step 1: Install Hls.js and Mesh Delivery builds

From our CDN

                <!-- Hls.js build -->
<script src="//"></script>

<!-- Mesh Delivery wrapper -->
<script src="//"></script>


To get the highest flexibility of deployment, we recommend setting the StreamrootKey in the Query Parameter "srKey".


Parameter name





The unique Streamroot key that we have assigned to you; make sure it is identical to the one provided in the Account section of your dashboard.

Using npm

Install runtime and dev dependencies:

                npm install @streamroot/hlsjs-dna-wrapper

In your application, import/require the package you want to use, like this example:

                import HlsjsDnaWrapper from '@streamroot/hlsjs-dna-wrapper';

Step 2: Set up Hls.js and Mesh Delivery

In the HTML <body> or with npm

                <video id="demoplayer"></video>
    var hlsjsConfig = {};
    var dnaConfig = {};
    var hls = new Hls(hlsjsConfig);
    var wrapper = new HlsjsDnaWrapper(hls, 'YOUR_STREAMROOT_KEY', dnaConfig);
    var video = document.getElementById('demoplayer');
    hls.on(Hls.Events.MANIFEST_PARSED,function() {;

Vizualization graph for Mesh Delivery

Recommended Options

                var hlsjsConfig = {
   "maxBufferSize": 0,
   "maxBufferLength": 30,
   "liveSyncDuration": 30,
   "liveMaxLatencyDuration": Infinity

                var hlsjsConfig = {
   "maxBufferSize": 0,
   "maxBufferLength": 30