Logo

Application collectors

Dash.js Media Player

v2.26.0 • For the Javascript Collector

The Dash.js 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. Integrate the Dash.js plugin into your web application with the following snippet:

<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 a Dash.js

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

datazoom_context = datazoom.createContext(dashjs_player);

For example:

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

<head>
    <!-- THE DASHJS CDN -->
    <script src="https://reference.dashif.org/dash.js/latest/dist/dash.all.min.js"></script>
    <!-- THE DATAZOOM BEACON SCRIPT -->
    <script src='https://platform.datazoom.io/beacon/v1/config?configuration_id=CONFIG_ID'></script>
</head>

<body>

    <div>
         <video id="video" controls style="width:50%;height:50%"></video>
    </div>

    <script>
    
        var dashjs_player;
        var datazoom_context;

        var url = "https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd";
          
        // Create a MediaPlayer and initialize it.
        dashjs_player = dashjs.MediaPlayer().create();
        dashjs_player.initialize(document.getElementById("video"), url);

        // Activates data collection
        datazoom_context = datazoom.createContext(dashjs_player);
        
    </script>

</body>

</html>

Stop Data Collection

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

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

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

NPM (Node Package Manager)

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

References:

Dash.js API Doc : Getting started with the Web SDK | Dash.js Documentation


CMCD Support

Datazoom provides two discrete settings that control CMCD data collection, one for a specific player event, “Media Object Request”, and one for the corresponding CDN log response.

Player Collector configuration options

Use this option to enable your configured CDN to collect and return CMCD data, contained in the CMCD node of the log line JSON

  • Off - no CMCD keys are passed

  • Lite - only the CMCD keys Session ID (sid) and Request ID (rid) are passed to the CDN via query parameter or request header with every “Media Object Request”.

  • Full - the full set of keys specified by the CMCD standard are passed to the CDN via query parameter or request header with every “Media Object Request”

    Screenshot 2024-04-18 at 1.49.13 PM.png

Bitmovin and JW Player support only the “Lite” setting above

Data Pipe configuration options

Select the CMCD data points you wish to be included in content requests.

  • Media Object Request - The video player will emit an event called “media_object_request” that will contain the selected CMCD keys below

  • CMCD keys - Select the CMCD keys you wish to have included with each Media Object Request

Ad Frameworks Extensions

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

Supported Features