Close
Menu

Enable ad event reporting

This demo showcases how to enable ad event reporting for viewability measurement and tracking.

var conf = {
  key: '<YOUR PLAYER KEY>'
};

var source = {
  dash: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd',
  hls: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8',
  progressive: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/MI201109210084_mpeg-4_hd_high_1080p25_10mbits.mp4',
  poster: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/poster.jpg'
};

var playerContainer = document.getElementById('player-container');
var player = new bitmovin.player.Player(playerContainer, conf);

player.load(source);

  • Ad start
  • Ad quartile pings
  • Ad error
  • Ad complete
player.on(bitmovin.player.PlayerEvent.AdStarted, function (data) {
    console.log("On Ad Started: " + JSON.stringify(data));
});

player.on(bitmovin.player.PlayerEvent.AdQuartile, function (data) {
    console.log("On Ad Quartile: " + JSON.stringify(data));
});

player.on(bitmovin.player.PlayerEvent.AdError, function (data) {
    console.log("On Ad Error: " + JSON.stringify(data));
});

player.on(bitmovin.player.PlayerEvent.AdBreakFinished, function (data) {
    console.log("On Ad Break Finished: " + JSON.stringify(data));
});
Event Log

Create an account to get started!

No credit card required.