admin管理员组

文章数量:1287860

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: .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[
                                .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&vtid=v_00000_hashid
                                ]]>
                            </MediaFile>
                            <MediaFile delivery="progressive" width="640" height="480" scalable="true" type="application/javascript" apiFramework="VPAID">
                                <![CDATA[
                                .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&vtid=v_00000_hashid
                                ]]>
                            </MediaFile>
                        </MediaFiles>
                    </Linear>
                </Creative>
            </Creatives>
        </InLine>
    </Ad>
</VAST>

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./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./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.&vtid=v_00000_hashid
                                ]]>
                            </MediaFile>
                            <MediaFile delivery="progressive" width="640" height="480" scalable="true" type="application/javascript" apiFramework="VPAID">
                                <![CDATA[
                                http://example./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.&vtid=v_00000_hashid
                                ]]>
                            </MediaFile>
                        </MediaFiles>
                    </Linear>
                </Creative>
            </Creatives>
        </InLine>
    </Ad>
</VAST>

Share Improve this question edited Dec 24, 2015 at 10:35 EJW 3383 gold badges7 silver badges18 bronze badges asked Dec 15, 2015 at 8:32 Simon FerndrigerSimon Ferndriger 4,9626 gold badges33 silver badges62 bronze badges 2
  • The reason for not using a player is that we have a self-made slideshow player for still images. – Simon Ferndriger Commented Dec 15, 2015 at 8: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 pliant player. – Oli C Commented Dec 18, 2015 at 10:55
Add a ment  | 

2 Answers 2

Reset to default 5

You can use Google's IMA SDK to handle the fetching and handling of the response. It's good for any standards-pliant 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./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 mented 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.

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.

本文标签: javascriptRun VAST without (a standard) PlayerStack Overflow