Socket
Book a DemoInstallSign in
Socket

@azerion/preroll

Package Overview
Dependencies
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azerion/preroll

Google IMA SDK HTML5 preroll

latest
npmnpm
Version
1.1.3
Version published
Maintainers
5
Created
Source

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!

FAQs

Package last updated on 21 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts