16

An answer to this question will hugely be appreciated!

Anyway, it is the first time I see a VAST tag. Now, the idea is to run/implement it without having or using a regular player. Is this possible to do just with using JavaScript events? And how exactly?

The tag looks like this: http://example.com/www/delivery/vst.php?zoneid=000&id=website

<VAST version="2.0">
    <Ad id="VPAID">
        <InLine>
            <AdSystem version="1.0">AD COMPANY</AdSystem>
            <AdTitle>VPAID Ad Manager</AdTitle>
            <Impression/>
            <Creatives>
                <Creative sequence="1">
                    <Linear>
                        <Duration>00:00:15</Duration>
                        <MediaFiles>
                            <MediaFile delivery="progressive" width="640" height="480" scalable="true" type="application/x-shockwave-flash" apiFramework="VPAID">
                                <![CDATA[
                                http://example.com/www/admanager/AdManager.swf?zoneid=000&id=website&ft1=10&ft2=40&ft3=5&ft4=30&ft5=0.5&ft6=10&ft7=20&ht1=5&ht2=40&ht3=5&ht4=30&ht5=0.5&ljt=example.com&vtid=v_00000_hashid
                                ]]>
                            </MediaFile>
                            <MediaFile delivery="progressive" width="640" height="480" scalable="true" type="application/javascript" apiFramework="VPAID">
                                <![CDATA[
                                http://example.com/www/admanager/ad-manager.js#zoneid=000&id=website&ft1=10&ft2=40&ft3=5&ft4=30&ft5=0.5&ft6=10&ft7=20&ht1=5&ht2=40&ht3=5&ht4=30&ht5=0.5&ljt=example.com&vtid=v_00000_hashid
                                ]]>
                            </MediaFile>
                        </MediaFiles>
                    </Linear>
                </Creative>
            </Creatives>
        </InLine>
    </Ad>
</VAST>
EJW
  • 338
  • 3
  • 6
  • 18
Simon Ferndriger
  • 4,455
  • 6
  • 28
  • 53
  • The reason for not using a player is that we have a self-made slideshow player for still images. – Simon Ferndriger Dec 15 '15 at 08:32
  • Hi Simon- it is possible, but would require writing a VPAID framework into your slide show to be able to call and display an ad. Have you considered using a player to display the slides instead, then you can use an existing vpaid compliant player. – Oli C Dec 18 '15 at 10:55

2 Answers2

5

You can use Google's IMA SDK to handle the fetching and handling of the response. It's good for any standards-compliant VAST or VMAP, not just DFP.

You can use the IMA SDK without a video player if you do want. I've modified Google's getting started example here and removed the video element: http://jsbin.com/dosexa/edit?html,css,js,output

The container for the ad can be a div:

var adDisplayContainer =
new google.ima.AdDisplayContainer(document.getElementById('adContainer'));

The ads manager requires a video element (or something implementing some of a video element's API) but this can be an empty video element:

adsManager = adsManagerLoadedEvent.getAdsManager(document.createElement('video')); 

The example I've used there is VPAID, as in your example. There's a video ad tag commented out.

Using a pre-built integration with a player may still be simpler. Google provide a plugin wrapper to use the SDK with video.js.

misterben
  • 7,455
  • 2
  • 26
  • 47
  • Thank you so much already. Now: the example works fine for the [test ad](https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpreonly&cmsid=496&vid=short_onecue&correlator=) - unfortunately, it does not work for our ad (http://ap.lijit.com/www/delivery/vst.php?zoneid=314506&sovrnid=lookr1) - is this because it is not HTTPS? If so, they don't have a HTTPS version I'm afraid... – Simon Ferndriger Dec 21 '15 at 12:17
  • The console output is *"An unexpected error occurred within the VPAID creative. Refer to the inner error for more info."* Maybe the problem is just that there are currently no ads available? How do I know best (without creating an error whether ads are available or not? This is a crucial information though. Thank you in advance! – Simon Ferndriger Dec 21 '15 at 16:27
  • That message comes from the SDK but the console output before that is from the js vpaid script. It's logging messages such as `calling server` and `no ads available`, so yes, it looks like an ad inventory issue. HTTP would also be an issue on an HTTPS site though. – misterben Dec 21 '15 at 18:41
  • OK, I'll check that with our ad partner and get back to you as soon as they have ads running. – Simon Ferndriger Dec 22 '15 at 13:44
  • Unfortunately, our ad partner is unable to provide what's needed to test your solution. Since it looks sound, I want to give you your earned bounty anyway. By the way: you don't know any good preroll video ad partner, who is technically competent and operating worldwide? – Simon Ferndriger Jan 21 '16 at 08:28
  • The code that you provided only works with pre-roll. How does it detect that there is a mid-roll or post-roll and starts playing? Test this tag: https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator= and you will see. Only the pre-roll plays, then nothing to tell the ad manager to play mid-roll or post-roll. – abelabbesnabi Jun 17 '19 at 18:44
  • This question is about playing ads without a player, and so with no content video. If there's no content video, there is no midroll or postroll. You probably want your ad server to return a pod of prerolls. – misterben Jun 21 '19 at 06:27
2

Yes, it is possible to implement VAST entirely in Javascript using just HTML5 and without the need of a specialized player.

As an example, take a look at videojs-vast-plugin. It uses this project for parsing the VAST resource and then it uses videojs to actually play an ad. It supports just preroll ads but it can be extended to add support for other kinds of ads.

Of course you can write your own VAST parsing library and instead of videojs use a Media Element (ether video or audio) to play the actual ads. VAST does not require anything that's not already present in Javascript and HTML5.

Svetlin Mladenov
  • 4,307
  • 24
  • 31