Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run VAST without (a standard) Player?

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>
like image 827
Simon Ferndriger Avatar asked Dec 15 '15 08:12

Simon Ferndriger


2 Answers

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.

like image 89
misterben Avatar answered Oct 07 '22 04:10

misterben


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.

like image 32
Svetlin Mladenov Avatar answered Oct 07 '22 06:10

Svetlin Mladenov