what is this?
Initialize hls.js with akamai analytics
Installations?
npm i akamaianalyticshls --save
Then...
let akamaianalyticshls = require('akamaianalyticshls');
//or
import(akamaianalyticshls) from "akamaianalyticshls"
let loadFile = akamaianalyticshls.loadAnalyticsFile(); //config stuffs
if (loadFile==true){
let hlsmediaAnalytics = akamaianalyticshls.initAnalytics(beconFile, hlsPlayerInstance);
// then
hlsmediaAnalytics.setData("title", "Game Of Thrones - Season 1 Winter Is Coming");
hlsmediaAnalytics.setData("eventName", "Game Of Thrones - Season 1 Winter Is Coming");
hlsmediaAnalytics.setData("device", "iPhone 7");
hlsmediaAnalytics.setData("deliveryType", "L");
hlsmediaAnalytics.setData("cdn", "Akamai");
hlsmediaAnalytics.setData("category", "TV Shows");
hlsmediaAnalytics.setData("subCategory", "Fantasy Drama");
hlsmediaAnalytics.setData("show", "Game Of Thrones");
hlsmediaAnalytics.setData("contentLength", "3697"); // Value in seconds
hlsmediaAnalytics.setData("playerId", "SamplePlayer01");
}