Created
August 7, 2019 12:56
-
-
Save marcelbeumer/94bff44ee8cd6e4308c7062f221f05ac to your computer and use it in GitHub Desktop.
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 characters
// video player api code | |
setContent(content: VideoContent) { | |
// ... | |
videoJsPlayer.src(sources) | |
// ... | |
tracker({ content, type: 'contentChanged' }) | |
}, | |
// our player tracker code that gets a contentChange event | |
switch (event.type) { | |
case 'contentChanged': | |
const { trackingProperties } = event.content | |
if (bitmovinAnalytics) { | |
const metadata = trackingProperties && trackingProperties.bitmovinAnalytics | |
// FIXME: using internal APIs to get things working but we shouldn't | |
const { analytics } = bitmovinAnalytics | |
analytics.sample = analytics.setupSample() | |
analytics.startupTime = 0 | |
analytics.config = { ...analytics.config, ...metadata } | |
analytics.init() | |
} | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment