Static VAST XML Tag

To access these features, Upgrade Now

In the event that you'd like to serve a static preroll with minimal tracking, it is possible to create your own custom VAST tag. Such a setup allows you to run your own video ads without using an adserver. The below XML displays a very basic video preroll that is built according to the IAB VAST spec:

<VAST version="2.0">
  <Ad id="static">
      <AdSystem>Static VAST Template</AdSystem>
      <AdTitle>Static VAST Tag</AdTitle>
              <Tracking event="start"></Tracking>
              <Tracking event="firstQuartile"></Tracking>
              <Tracking event="midpoint"></Tracking>
              <Tracking event="thirdQuartile"></Tracking>
              <Tracking event="complete"></Tracking>
              <Tracking event="pause"></Tracking>
              <Tracking event="mute"></Tracking>
              <Tracking event="fullscreen"></Tracking>
              <MediaFile type="video/mp4" bitrate="300" width="480" height="270">

Note that VAST/VPAID advertising is only available in the Platinum and Enterprise editions of JW Player. See our pricing page for more info.

A few notes on this setup:

  • Like other XML content, VAST tags are subject to cross-domain loading restrictions. See Crossdomain File Loading if you plan to serve the VAST tags from a different domain than your JW Player.
  • The impression tracker and all tracking events are required by the VAST specification. You could link them to e.g. a pixel on your server if you don't plan to actually use these trackers.
  • The VideoClicks section defines the link for clicking the ad. If you don't want a clickthrough, simply remove this section.
  • The MediaFiles section points to your MP4 creative. Note the bitrate, width and height attributes must also be set. Alternatively, you could use an FLV file, but that one won't be HTML5 compatible.

Next Steps

In order to properly serve the above, the contents must be placed inside of an XML file which is hosted and served to the player in a method similar to our preroll article here.


var playerInstance = jwplayer("myElement");
    image: "/uploads/myPoster.jpg",
    file: "/uploads/myVideo.mp4",
    advertising: {
      client: "vast",
      tag: "/uploads/myStaticTag.xml"

Did you find this article helpful?

Please log in to rate this article.