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">
    <InLine>
      <AdSystem>Static VAST Template</AdSystem>
      <AdTitle>Static VAST Tag</AdTitle>
      <Impression>http://example.com/pixel.gif</Impression>
      <Creatives>
        <Creative>
          <Linear>
            <Duration>00:00:08</Duration>
            <TrackingEvents>
              <Tracking event="start">http://example.com/pixel.gif</Tracking>
              <Tracking event="firstQuartile">http://example.com/pixel.gif</Tracking>
              <Tracking event="midpoint">http://example.com/pixel.gif</Tracking>
              <Tracking event="thirdQuartile">http://example.com/pixel.gif</Tracking>
              <Tracking event="complete">http://example.com/pixel.gif</Tracking>
              <Tracking event="pause">http://example.com/pixel.gif</Tracking>
              <Tracking event="mute">http://example.com/pixel.gif</Tracking>
              <Tracking event="fullscreen">http://example.com/pixel.gif</Tracking>
            </TrackingEvents>
            <VideoClicks>
              <ClickThrough>http://www.jwplayer.com/</ClickThrough>
              <ClickTracking>http://example.com/pixel.gif</ClickTracking>
            </VideoClicks>
            <MediaFiles>
              <MediaFile type="video/mp4" bitrate="300" width="480" height="270">
                http://example.com/uploads/myPrerollVideo.mp4
              </MediaFile>
            </MediaFiles>
           </Linear>
        </Creative>
      </Creatives>
    </InLine>
  </Ad>
</VAST>

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.

Example

 
var playerInstance = jwplayer("myElement");
  playerInstance.setup({
    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.