Lumen help

Integrating Mesh Delivery with Cloud Video Platform (Mpx Player)

Introduction

Step 1: Add Mesh Delivery as a custom script file

                https://cdn.streamroot.io/mpx-hls-dna-plugin/1/stable/mpx-hls-dna-plugin.js?srKey=YOUR_STREAMROOT_KEY
            
                https://cdn.streamroot.io/mpx-dash-dna-plugin/1/stable/mpx-dash-dna-plugin.js?srKey=YOUR_STREAMROOT_KEY
            

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

 

Parameter name

Mandatory

Description

YOUR_STREAMROOT_KEY

Yes      

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.

Step 2: Add Mesh Delivery options as a custom script

Declare Mesh Delivery options in a streamrootDna JSON and copy/paste it in the "Custom script" input, and click on 'Save' as shown in figure below.

                var streamrootDna = {
  "streamrootKey": "YOUR_STREAMROOT_KEY",
  "dnaConfig": {}
} 

            
Adding mesh delivery options on the Mpx console

Step 3: Visualize Mesh Delivery stats in your console

To display basic DNA stats in your browser console, copy/paste the following snippet in the "Custom script" input of your player:

                !function(){function n(){if(Streamroot.instances.length){var n=Streamroot.instances[0].stats,t=n.allContents.dnaDownload?n.allContents.dnaDownload/(n.allContents.dnaDownload+n.allContents.cdnDownload)*100:0,a={upload:o(n.allContents.dnaUpload),dna:o(n.allContents.dnaDownload),cdn:o(n.allContents.cdnDownload),efficiency:`${t}%`,peers:n.realtime.dnaSources};console.table(a)}else console.warn("Streamrooot not initialized")}function o(n,o=10){if(0===n)return"0B";var t=o+1||1,a=Math.floor(Math.log(n)/Math.log(1e3));return parseFloat((n/1e3**a).toFixed(t))+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][a]}setInterval(()=>{n()},1e4),n()}();
            

You should have the following table, which is updated every 10 seconds:

Mesh Delivery stats on browser console

Recommended Hls.js options

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