Created
August 9, 2019 06:44
-
-
Save michael-riha/2a58abc71222b7642af98ed5fea39fe0 to your computer and use it in GitHub Desktop.
Revisions
-
michael-riha created this gist
Aug 9, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ const analyticsConfig = { key: '<ANALYTICS-KEY>', videoId: 'video-empty', userId: 'xxx_01', cdnProvider: 'some_cdn', customData1: 'sport', title: 'video title set without a source, yet', debug: true }; const player = videojs('my-player'); const analytics = new bitmovin.analytics.adapters.VideojsAdapter(analyticsConfig, player); player.ready(function(event) { console.log("player is ready"); let sourceConfig= { title: 'the first video title set with first source', videoId: 'video-1' } console.log("before change-> ", analytics.analytics.sample.videoId, analytics.analytics.sample); analytics.sourceChange(sourceConfig); console.log("after change-> ", analytics.analytics.sample.videoId, analytics.analytics.sample); player.src({ src: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8', type: 'application/x-mpegURL', }); });