1.0.9 • Published 2 years ago

vpaid-html5-client-override-loadadunit v1.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

VPAIDHTML5Client

bitHound Score Code Climate Test Coverage Build Status devDependency Status

About

JS iframe wrapper for VPAID.

VPAID or Video Player Ad-Serving Interface Definition, establishes a common interface between video players and ad units, enabling a rich interactive in-stream ad experience.

The goals of VPAIDHTML5Client are:

  • common interface for VPAID in different technologies HTML5 and FLASH.
  • handle how to load the VPAID adUnit
  • be a simple and "stupid" implementation of VPAID

check videosjs-vast-vpaid if you need VPAID in videojs

JS

The project uses:

TODO

  • test how will work with a real ad in the demo and test
  • try to use the slot element inside the iframe to see if the ad's will not mess the css of the page
  • validate better if the postmessage and iframe works across browsers

Example of the usage

var vpaid = new VPAIDHTML5Client(el, video, {});
var data = {
  mediaFile: "mediaFile.js",
  interactiveCreativeFile: "interactiveCreativeFile.js",
  verifications: "verifications.js"
}

vpaid.loadAdUnit(data, onLoad);

function onLoad(err, adUnit) {
    if (err) return;

    adUnit.subscribe('AdLoaded', onInit);
    adUnit.subscribe('AdStarted', onStart);

    adUnit.handshakeVersion('2.0', onHandShake);

    function onHandShake(error, result) {
        adUnit.initAd(480, 360, 'normal', -1, {AdParameters: currentAd.adParameters}, {});
    }

    function onInit() {
        adUnit.startAd();
    }

    function onStart() {
        console.log('-> AdStarted');
    }

}

License

licensed under the MIT License, Version 2.0. View the license file

Copyright © 2015 MailOnline

1.0.9

2 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago