Giter VIP home page Giter VIP logo

vpaidhtml5client's Introduction

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

Running the project

  • install nodejs and gulp
  • npm install to install all dependencies
  • gulp serve or npm start to start build script and a demo page should be open in default browser
  • gulp to watch, bundle and run tests
  • npm test or gulp test:ci task used by the server
  • gulp deploy:demo task used to update githubpage with demo and bin

Example of the usage

var vpaid = new VPAIDHTML5Client(el, video, {});
vpaid.loadAdUnit('vpaidAdURL.js', 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

vpaidhtml5client's People

Contributors

alexalexandrescu avatar fetz avatar lizozom avatar nerdynick avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.