Integration‎ > ‎

Preroll Video

Preroll video has never been this easy.
Integrating Vdopia preroll video to your website takes about 3 mins of your time. Mobile preroll video from Vdopia requires that you have direct links from your page to the video.
Following is the example of a mobile video page before vdopia preroll has been enabled:
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
</head>
<body>
<a href="http://cdn.vdopia.com/files/videos/008ddcd5f46eba49b0a9af60e5940d19_a.mp4"><img src="http://demo.vdopia.com/vdo/wapDemo/images/play-button.png" alt="Play Button" class="play_button" border="none" /></a>
</body>
</html

In order to enable vdopia preroll you need to do two things:
1. Include the following script in your page: 
<script src='http://serve.vdopia.com/adserver/html5/inwapads/?adFormat=inappvideo&fullscreen=1&attr=rel&val=preroll&ak=<YOUR_VDOPIA_APIKEY>&version=1.0'></script>

2. Modify the videos you need to enable preroll on by adding rel="preroll" attribute. 
<a rel="preroll" href="http://cdn.vdopia.com/files/videos/008ddcd5f46eba49b0a9af60e5940d19_a.mp4"><img src="images/play-button.png" alt="Play Button" class="play_button" border="none" /></a>

Final code after doing the changes to the above page code will look like this: (Using VDOPIA_API_KEY:AX123)
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />


<script src='http://serve.vdopia.com/adserver/html5/inwapads/?adFormat=inappvideo&fullscreen=1&attr=rel&val=preroll&ak=AX123&version=1.0'></script>


</head>
<body>
<a rel="preroll" href="http://cdn.vdopia.com/files/videos/008ddcd5f46eba49b0a9af60e5940d19_a.mp4"><img src="http://demo.vdopia.com/vdo/wapDemo/images/play-button.png" alt="Play Button" class="play_button" border="none" /></a>
</body>
</html

Voila you have preroll enabled on your videos. Isn't that easy. If you think so you need to try our other mobile web ad formats at: Vdopia in WAP API

Demo:

Tag used in example:
<script src='http://serve.vdopia.com/adserver/html5/inwapads/?adFormat=inappvideo&fullscreen=1&attr=rel&val=preroll&ak=AX123&version=1.0'></script>

Launching Preroll using JS call

It is also possible to launch pre-roll ads (or video interstitials) using a javascript call. The ad script makes the function 'vdoRenderAd' available which can be called to launch the loaded video ad.

Demo (launches an ad 5 seconds after the page is loaded):

Tag used in example:
<script src="http://serve.vdopia.com/adserver/html5/inwapads?sleepAfter=0;slide=0;version=1.0;ak=AX123;adFormat=inappvideo;element=null;fullscreen=1"></script>

Javascript code to launch a video ad:
function launchAd(){ if(typeof vdoRenderAd !== 'function' || !vdoRenderAd()) vdoAutoRenderAd=true; }