3

I have a requirement to call an API to my server from the device before playing the media file in VAST Tag.

I am able to load the javascript with

<MediaFiles>
        <MediaFile delivery="progressive" width="16" height="9" type="application/javascript" apiFramework="VPAID">
              <![CDATA[<URL TO JS]]>
        </MediaFile>
</MediaFiles>

But how do I call a function inside the loaded javascript and then load the 3rd party VAST TAG with some information.

EDITED

I need to load 3rd party VAST tag inside a 3rd party video player. We have the URL to the 3rd party VAST like : http://demo.tremorvideo.com/proddev/vast/vast_wrapper_linear_1.xml

I do not have the control where the URL will be loaded on which VAST player. I am testing here : http://zutils.zedo.com/vastvalidator/#/vastInspector

But before loading the VAST URL, I need to make REST API call to our backend, get the response and make some decisions on the client, then call the 3rd party VAST.

So after our rest API call, the 3rd party VAST might look like : http://demo.tremorvideo.com/proddev/vast/vast_wrapper_linear_1.xml?rest_response=

How do I create a wrapper VAST Tag to make this happen?

Avi Chopra
  • 143
  • 1
  • 10
  • It's not clear what you are asking. _As you can not have the VPAID JS before loading the VAST!?!_ Please adjust your question and be more specific. What is the actual problem? – zyexal Aug 22 '16 at 11:28
  • My requirement is to call a javascript function(which internally call rest api) inside VAST/VPAID tag, and based on the function response load a specific VAST tag. – Avi Chopra Aug 22 '16 at 12:29
  • As I said, please try to be more specific in you question. _VAST responses are just XML (nothing to call here)_ You might want to use some kind of proxy VPAID? Meaning a VPAID (JS/Flash) which calls your RESTful Service, to get a VAST response and displays the Media described within the VAST. If not, please adjust the question so it is 100% clear! – zyexal Aug 22 '16 at 13:18
  • @zyexal: can you give me example of the way you mentioned? – Avi Chopra Aug 26 '16 at 18:09
  • Let me know if this wasn't helpful anyway, so I can delete the answer. – zyexal Aug 26 '16 at 21:59

1 Answers1

1

First things first:

VAST (Video Ad Serving Template): XML document format describing an ad to be displayed in, over, or around a Video Player or a Wrapper pointing to a downstream VAST document to be requested.

VPAID (Video Player Ad-Serving Interface Definition): Establishes a common interface between video players and ad units, enabling a rich interactive in-stream ad experience.

Your question is (currently) confusing, as it's not clear what you want to achieve. What I got so far is:

  1. Player loads VAST - MediaFile: VPAID
  2. VPAID shall load another (third party) VAST - if you call a specific JS function
  3. Third Party MediaFile play-out

Assuming the VPAID is yours (Proxy VPAID)

Every player which supports VPAID (and your VPAID version) will call the initAd() function. There is no need to implement a magic function to contact your API for the third party VAST tag. Just implement the API call with VAST response, so it will be executed if VPAID.initAd gets called.
Note 1: Your VPAID would need to be a fully qualified VAST/VPAID player itself.
Note 2: You would need to implement it for JavaScript and Flash

Assuming the VPAID isn't yours

No VPAID will provide a functionality to replace the content - the advertiser actually wants to serve - with different content. Not via VAST or anything. Cause it would not make sense for the advertiser ;)

Assuming the player is yours

You could implement that API call (simple VAST resource request) into your player, so it will get the third party VAST directly. No VPAID needed.
Note: Please also have a look for VAST Wrapper - this might help.

If nothing of this is what you want to achieve, please please please edit your question so it is 100% clear what you are asking for.

I hope this was helpful somehow and have a nice day!

Community
  • 1
  • 1
zyexal
  • 1,510
  • 15
  • 23
  • thanks for the answer, I have edited my question. The problem is we do not have our own VAST tag or player. But we want to create a wrapper which can call 3rd party VAST after making a REST API, get a response make some decisions on the client itself and then call 3rd party TAG with some parameters. – Avi Chopra Aug 27 '16 at 06:18
  • If you want to *make some decisions on the client* side, you would need to use the VPAID proxy thing. Problem: you can't be sure that the player is able to playout VPAID *- it possibly skips your ad*. Best option should be the VAST-Wrapper and to make decisions on **server side**. For implementation details regarding VAST Wrapper please have a look into the specs. There is no magic :) – zyexal Aug 27 '16 at 06:37