@azerion/preroll

1.1.3 • Public • Published

Google IMA SDK HTML5 preroll

This tool wil display a video preroll using the Google IMA HTML5 SDK. https://developers.google.com/interactive-media-ads/

Overlay ads are turned off by default and there is no actual video playback possible. So this preroll is only intended for game prerolls, not video content prerolls.

Getting started

Lets start by installing the package, like most of the other package we will make use of NPM

npm install @azerion/preroll --save-dev

Now lets call get the tool in our project.

import Preroll from '@azerion/preroll';

At last let's call the feature!

var preroll = new Preroll('boule-slot', {
    prefix: 'preroll_',
    autoStart: false,
    responsive: true,
    width: 640,
    height: 360,
    debug: false,
    locale: 'en',
    tag: 'https://pubads.g.doubleclick.net/gampad/ads?' +
        'sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&' +
        'impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&' +
        'cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=',
    managerLoaded: function(autoPlayEnabled) {
        console.info('IMA MANAGER LOADED', autoPlayEnabled);
    },
    loaded: function() {
        console.info('IMA LOADED');
    },
    started: function() {
        console.info('IMA STARTED');
    },
    clicked: function() {
        console.info('IMA CLICKED');
    },
    closed: function() {
        console.info('IMA CLOSED');
    },
    completed: function() {
        console.info('IMA COMPLETED');
    },
    error: function(message) {
        console.error('IMA ERROR', message);
    }
});
preroll.initialize();
preroll.play();

note: Only the first parameter is REQUIRED. The second argument of Preroll() is all optional properties

And done, it's that simple!

Readme

Keywords

none

Package Sidebar

Install

npm i @azerion/preroll

Weekly Downloads

0

Version

1.1.3

License

ISC

Unpacked Size

44.6 kB

Total Files

4

Last publish

Collaborators

  • moin.hasan
  • hulsman1986
  • alebles