Logo

Application collectors

HTML5 Media Player

v2.31.0 • For the Javascript Collector

The HTML5 Media Player Extension is a configuration option for the Javascript Collector by Datazoom that makes the following additional data points automatically collectable in real time.

Integration Instructions

Plugin Integration

Datazoom provides plugins for data collection through our Beacon Services.

<script src='https://platform.datazoom.io/beacon/v1/config?configuration_id=CONFIG_ID'></script>
  • Insert this JS line into your HTML

  • Replace the CONFIG_ID value with the collector configuration ID.

This inserts Datazoom's data collection SDK into the page.

Activate Data Collection for an HTML5 Player

To activate data collection for HTML5 instance, create a Datazoom context which references the player instance with the following snippet:

datazoom_context = datazoom.createContext(html5_player);

For example:

<!DOCTYPE html>
<html lang="en">

<head>
  <!-- THE DATAZOOM BEACON SCRIPT -->
  <script src='https://platform.datazoom.io/beacon/v1/config?configuration_id=CONFIG_ID'></script>
</head>
<body>
<div style="position:relative;width:640px;height:360px">
    <video id="video" style="position:absolute;top:0;left:0;width:100%;height:100%" controls></video>
</div>
<script> 
  var html5_player;
  html5_player = document.getElementById("video");
  html5_player.src = "https://storage.googleapis.com/interactive-media-ads/media/android.mp4";
  var datazoom_context = datazoom.createContext(html5_player);   
</script>
</body>

</html>

Stop Data Collection

If the data collection must be stopped for any reason, invoke the destroy() method of the Datazoom context object as in the following example:

if (datazoom_context) {
    datazoom_context.destroy();
    datazoom_context = null;
}

NPM (Node Package Manager)

We have made it convenient to manage your HTML5 Collector integration by providing NPM (Node Package Manager) support. Please see installation details here.



Ad Frameworks Extensions

If your Javascript application has a media player with an ad framework, Datazoom’s Javascript Collector with a HTML5 Media Player can be extended with the following ad framework extensions.