Videojs VAST Multiple ads

AD EVENTS

The most often used method to play multiple VAST ads at different time positions is to use VMAP protocol. VMAP is used by many ad providers, including Google. VAST plugin by Nuevodevel.com includes experimental support for VMAP. Example test of VMAP Ads Playlist is available to review as well.

An alternative for VMAP protocol is Ads Scheduler implemented in VAST/VPAID plugin, which also allows to define and play multiple VAST ads.In example above you can see total 5 VAST ads. 2 x preroll, 2 x midroll at 00:15 and 1 x postroll ad. Below you you have example of ads setup code.
Code snippet
player.vastAds ([
   {tagURL: "preroll-1-ad-tag-url", id: 'x01'},
   {tagURL: "preroll-2-ad-tag-url", id: 'x02'},
   {tagURL: "midroll-1-ad-tag-url", id: 'x03', timeOffset:"00:15"},
   {tagURL: "midroll-2-ad-tag-url", id: 'x04', timeOffset:'00:15'},
   {tagURL: "postrol-ad-tag-url", id: 'x04', timeOffset:'end'}
]);

As you can see, you can define multiple preroll ads to play one after another, multiple midroll ads at same or different time position and finally postroll ad.
For midroll ad you must define timeOffset option represented as number of seconds or as a string in time format, eg. "00:15".
For postroll ad timeOffset option must be represented as a string "end".
VAST/VPAID plugin is included only in GOLD version of Nuevo plugin.