Videojs VAST Plugin



More VAST Examples
Discover more potential of VAST advertising, including vast icons, nonlinear ads, ad companions and sequential ad pods

VAST Plugin Introduced

VAST/VPAID plugin dedicated for video.js player with Nuevo plugin and skin. The plugin implements IAB specifications of VAST 3, VAST 4 (rendered through VAST 3) and VPAID. Since flash playback is depreciated for video.js player, the plugin supports only HTML5 ads.
The PRO version of the plugin supports VMAP specification, which allows to play multiple ads at desired time position (mid-roll, post-roll). Apart of linear video ads, VAST plugin PRO support also nonlinear ads, industry icons and ad companions. Sequential ads as defined in the VAST 3 spec as ad pods are supported as well. The plugin includes option to build ads waterfall to maximize ad revenue by attempting to show a valid ad.

The plugin setup is not difficult.
Code snippet
Load player skins css stylesheet in website HEAD or BODY element.
<link href="/videojs/skins/skin-name/videojs.min.css" rel="stylesheet" type="text/css" />

Load player, vast/vpaid and nuevo plugin js
<script src="/videojs/video.min.js"></script>
<script src="/videojs/nuevo.min.js"></script>
<script src="/videojs/plugins/vastpro.js"></script>

Initialize player and plugins
var options = { option1: value, option2: value, option3: value }; Nuevo plugin options
var player=videojs("'example_video_1");
player.nuevo({ options });
player.vastAds ({ tagURL: "vast-ad-tag-url-here" });
By default the plugin makes XMLHttpRequest false flag for withCredentials property. This means that cookies are ignored in the XMLHttpRequest response. XMLHttpRequest responses from a different domain cannot set cookie values for their own domain unless withCredentials is set to true before making the request. You can enable withCredentials flag in easy way:
Code snippet
player.vastAds ({ tagURL: "vast-ad-tag-url-here", withCredentials:true });

Tracking Ad Events

The plugin allows to track ad events through javascript. Events fired are the same as possible to define in the VAST protocol. Below you have a sample javascript function which allows to track ad events.
Code snippet
player.on('vast', (e, data) => {
If you wish to reset ad(s) when loading new video or when the next video from playlist is loaded, just reset ads using simple function on certain action.
Reset ads on playlist change:
Code snippet
player.on('playlist_change', function(event,data) {
Reset ad(s) when changing video programmatically:
Code snippet
var new_source = {src: "//", type: "application/x-mpegURL"};
If you prefer to load new ad or set of ads than resetting existing ad(s), just load it in the standard way:
Code snippet
player.on('playlist_change', function(event,data) {
player.vastAds ({tagURL: "new-vast-ad-tag-url-here" });
Skip ad option depends on what skippable options are specified in the VAST document (skipOffset attribute) or skip option for non-standard ads.
Experimental option midrollSkip option allows to skip multiple mid-roll ads and play only last one behind scrubbed time. By default the option is disabled (false).
Code snippet
player.vastAds ({midrollSkip:true, tagURL: "vast-ad-tag-url-here" });
By default XMLHttpRequest is executed with default withCredentials flag (false). XMLHttpRequest responses from a different domain cannot set cookie values for their own domain unless withCredentials is set to true before making the request. You can change withCredentials flag value as an option:
Code snippet
player.vastAds ({withCredentials:true, tagURL: "vast-ad-tag-url-here" });
All texts related to ads like, "advertisement", "Ad", Skip Ad", "Skip Ad in", "Ad 1 of 2" can be translated to any other language. Just edit appropriate language .js file, find interesting text and translate. Check Languages demo to learn how to load any other than English existing language.
The VAST PRO plugin is a separate product for Nuevo software version minimum 10.0 licence holders.
Lifetime license per domain can be ordered upon first order, or any time later in client area.
Nuevo software GOLD plan users are entitled to an almost 40% discount off the basic price.