3

在播放 VAST 标记中的媒体文件之前,我需要从设备调用 API 到我的服务器。

我能够加载javascript

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

但是如何在加载的 javascript 中调用函数,然后加载带有一些信息的 3rd 方 VAST TAG。

已编辑

我需要在第 3 方视频播放器中加载第 3 方 VAST 代码。我们有第 3 方 VAST 的 URL,例如:http ://demo.tremorvideo.com/proddev/vast/vast_wrapper_linear_1.xml

我无法控制在哪个 VAST 播放器上加载 URL。我在这里测试:http: //zutils.zedo.com/vastvalidator/#/vastInspector

但是在加载 VAST URL 之前,我需要对我们的后端进行 REST API 调用,获取响应并在客户端做出一些决定,然后调用第 3 方 VAST。

因此,在我们调用 rest API 之后,第 3 方 VAST 可能如下所示: http ://demo.tremorvideo.com/proddev/vast/vast_wrapper_linear_1.xml?rest_response=

如何创建封装 VAST 代码来实现这一点?

4

1 回答 1

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!

于 2016-08-26T21:58:58.720 回答