You can use minimal XML code to display your VAST ads:

<VAST version="2.0">
            <Linear skipoffset="00:00:05">
                  <MediaFile delivery="progressive" type="video/mp4">
         <Extension type="linkTxt"><![CDATA[Go to the advertiser's website]]></Extension>

The link to the impression pixel is needed to count impressions, if you want to collect it. The player will send this request when the ad starts playing. The click-through link is required if the ad is clickable.

The skipoffset parameter allows you to configure the ad skip button (in the example, 5 seconds).

You can generate the ad code dynamically from your server, changing the links depending on the situation. This is called ad rotation. For example, the advertising XML generates your script at[id] - this address you specify in the player settings as an advertising link. To manage ads on different pages, just specify the vast_replace parameter in the player code.

var player = new Playerjs({id:"player", file:"", vast_replace:{"[id]":1}});

In this example, the request will go to


A wrapper is an intermediate document that forwards the request to another VAST. At the same time, it can contain a full set of its own pixels, which will work out at the right time. The minimal wrapper looks like this:

<VAST version="2.0">

How to completely disable ads in the code

To disable ads in the player code please add vast:0

19.3.112023 © PlayerJS

Sign up free

Sign up
By signing up, you agree to Terms of Service
Login if you have an account

Restore password

Forgot email? Contact us