This plugin reads a VAST file, grabs the first video it can, and plays it as a 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.

Try it out!


Include the plugin and it's dependencies:

<script src=""></script>
<script src="vast-client.js"></script>
<script src=""></script>
<script src="videojs.vast.js"></script>

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

plugins: {
    ads: {},
    vast: {
        url: ''

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

Check out example.html for a more detailed demo.

Fork me on GitHub