自定义 VAST XML

  抱歉,此页面正在等待翻译成土耳其语

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

<VAST version="2.0">
<Ad>
   <InLine>
      <AdSystem></AdSystem>
      <Impression>
         <URL><![CDATA[Link-to-impression-pixel]]></URL>
      </Impression>
      <Creatives>
         <Creative>
            <Linear skipoffset="00:00:05">
               <VideoClicks>
                  <ClickThrough><![CDATA[Link-for-click]]></ClickThrough>
               </VideoClicks>
               <MediaFiles>
                  <MediaFile delivery="progressive" type="video/mp4">
                     <![CDATA[Link-to-mp4]]>
                  </MediaFile>
               </MediaFiles>
            </Linear>
         </Creative>
      </Creatives>
      <Extensions>
         <Extension type="linkTxt"><![CDATA[Go to the advertiser's website]]></Extension>
      </Extensions>
   </InLine>
</Ad>
</VAST>

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 site.com/vast/preroll.php?id=[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:"https://site.com/video.mp4", vast_replace:{"[id]":1}});

In this example, the request will go to site.com/vast/preroll.php?id=1

Wrappers

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">
   <Ad>
      <Wrapper>
         <AdSystem></AdSystem>
         <VASTAdTagURI>
         <![CDATA[Link-to-another-VAST]]>
         </VASTAdTagURI>
         <Impression>
         <![CDATA[Link-to-impression-pixel]]>
         </Impression>
         <Creatives>
            <Creative>
               <Linear>
                  <TrackingEvents>
                     <Tracking event="click">
                        <![CDATA[Link-to-click-pixel]]>
                     </Tracking>
                  </TrackingEvents>
               </Linear>
            </Creative>
         </Creatives>
      </Wrapper>
   </Ad>
</VAST>

How to completely disable ads in the code

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


19.12.2
2024 © PlayerJS

登录

登录

免费注册

注册
注册即表示您同意服务条款
登录(如果您有帐户)

恢复密码

恢复
忘记电子邮件?联系我们