GithubHelp home page GithubHelp logo

neuralnoise / videojs-vast-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from theonion/videojs-vast-plugin

0.0 2.0 0.0 819 KB

A VideoJS plugin for VAST

Home Page: theonion.github.io/videojs-vast-plugin/

License: MIT License

JavaScript 97.23% HTML 2.06% CSS 0.71%

videojs-vast-plugin's Introduction

videojs-vast-plugin Build Status Coverage Status

This plugin reads a VAST file, grabs the first video it can, and plays it as pre-roll advertisement before your video. It will also click through to whatever url the advertiser designates, track any clicks, and fire all of the correct pixel trackers at the right times.

Usage

Include the plugin and it's dependencies:

<script src="http://vjs.zencdn.net/4.4.3/video.js"></script>
<script src="vast-client.js"></script>
<script src="video.ads.js"></script>
<script src="videojs.vast.js"></script>

Add "ads" and "vast" to the plugins object, and pass a url:

plugins: {
    ads: {},
    vast: {
        url: 'http://url.to.your/vast/file.xml'
    }
}

And when you play that video, a pre-roll ad should play beforehand.

If you click on the ad, an adclick event will trigger.

Check out the demo for a more detailed example.

This plugin is technically an integration for video.js's ads plugin. For more information on the various states in the preroll process, please refer to the videojs-contrib-ads documentation.

Options

  • url: a URL to the xml file.
  • skip: how long until the user can skip the ad. Defaults to 5, and a negative number will disable it.

Credit

This plugin uses dailymotion's vast client to read and parse the VAST files, and video.js's ads plugin for switching from pre-roll to content.

videojs-vast-plugin's People

Contributors

shaqq avatar nhjm449 avatar csinchok avatar dcharbonnier avatar jcruz2us avatar dmlap avatar

Watchers

James Cloos avatar Starbuck 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.