This article details how to use Streamroot DNA™ with Kaltura Player.
Not into tutorials? |
This plugin has been specially built to work with the Kaltura Management Console.
It currently only supports HLS Live and VoD streams.
Step 1: Add Streamroot plugin
In the KMC, go to your player setting in the STUDIO section >> Plugins.
Create a new plugin called "streamrootDna".
Copy/paste the Streamroot plugin URL in the object called "iframeHTML5Js":
//cdn.streamroot.io/kaltura-hls-dna-plugin/1/stable/kaltura-hls-dna-plugin.js
Step 2: Add Streamroot options
Add the following Options as new objects:
streamrootKey YOUR_STREAMROOT_KEY
dnaConfig ()
hlsjsConfig ()
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. |
dnaConfig | No |
The object in which you can pass Streamroot options (property, id, etc.). |
hlsjsConfig | No |
The object in which you can change hls.js options. More information can be found here. |
Then, click on Save.
Step 3: Visualize DNA stats in your console
To display basic DNA stats in your browser console, copy/paste the following snippet in your console and press Enter:
!function(){function n(){if(window.frames[0].Streamroot.instances.length){var n=window.frames[0].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:
To use Streamroot Stats, you need to Publish your player using the Dynamic Embed code. Using the standard Iframe Embed code will prevent from loading these Stats in the console.
Recommended hls.js options
hls.js has a wide variety of configuration parameters that can be instantiated in hlsjsConfig
object for fine-tuning. You can learn more about them in their API Documentation.
To get the best performance with live content, we recommend setting the following values:
hlsjsConfig ("maxBufferSize": 0, "maxBufferLength": 30, "liveSyncDuration": 30)
liveSyncDuration
is not needed for VoD. If used with VoD content, the Kaltura player won't load.