@orange-games/preroll
v0.0.6
Published
Google IMA SDK HTML5 preroll
Downloads
7
Readme
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 @orange-games/preroll --save-dev
Now lets call get the tool in our project.
import Homescreen from '@orange-games/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=',
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.info('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!