Videojs VAST Plugin

VAST PLUGIN PRO

VAST EVENTS

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, vast 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 waterfall ads 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/vast.vpaid.min.js"></script>

Initialize player and plugins
<script>
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" });
</script>
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 VAST protocol.
Below you have a sample javascript function which allows to track ad events.
Code snippet
<script>
player.on('vast', (e, data) => {
console.log(data.eventType);
});
</script>
If you wish to reset ad(s) when loading new video or when next video from playlist loaded, just reset ads using simple function on certain action.
Reset ads on playlist change:
Code snippet
player.on('playlist_change', function(event,data) {
player.vastReset();
})
Reset ad(s) when changing video programmatically:
Code snippet
var new_source = {src: "//www.domain.com/path-to-video-playlist.m3u8", type: "application/x-mpegURL"};
player.vastReset();
player.changeSource(new_source);
If you prefer to load new ad or set of ads than resetting existing ad(s), just load it in 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). You can only change skip button texts, either directly through vastAds options or by editing appropriate language texts.
Code snippet
player.vastAds ({skipInText:"Skip Ad in %%TIME%% seconds", skipAdText:"Skip Ad", tagURL: new-vast-ad-tag-url-here" });
The user may decide to start initial ad with audio off. Default value is "on".
Code snippet
player.vastAds ({audio:'off', tagURL: "vast-ad-tag-url-here" });
And one more experimental option, added on demand of one of our users. midrollSkip option allows to skip muultiple 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 ({widthCredentials:true, tagURL: "vast-ad-tag-url-here" });
VAST PRO plugin is separate product for Nuevo software version minimum 10.0 licence holders.
Licensed per domain can be ordered upon first order, or any time later in client area.
Nuevo software GOLD plan users are entitled for almost 40% discount off the basic price.