Sample Javascript VPAID Creatives?

4,014 views
Skip to first unread message

Denis Vilar

unread,
Mar 10, 2015, 10:40:52 AM3/10/15
to ima...@googlegroups.com
Hello,

I'm trying to test the Javascript VPAID support of the HTML5 SDK, are there any sample creatives that I can use? The ones in the example are either plain VAST videos or Flash-based Vpaid.

The only one I could find was this one from Sizmek, but it doesn't seem to work with I submit it in the Video suite inspector:

Thanks

Oli Cundale

unread,
Mar 10, 2015, 12:06:04 PM3/10/15
to ima...@googlegroups.com
Hey Denis, the reason that sample creative you have doesn't work is that the creative protocol in the vast response is 'http'. You need to make sure that everything is called securely with the IMA SDK, so that would need to be https in the response.

I have a VPAID flash preroll creative link that works, if that's any good for you?

Oli

Bret McGowen

unread,
Mar 10, 2015, 1:32:09 PM3/10/15
to ima...@googlegroups.com
Hi Denis,

There are some (unofficial) sample VPAID ads in this GitHub repo you can test with. They aren't Google-supplied so I can't guarantee that they work but they should at least get you pointed in the right direction. See also this guide for caveats and other considerations. 


Thanks,
Bret McGowen
IMA SDK Team

Denis Vilar

unread,
Mar 11, 2015, 10:27:22 AM3/11/15
to ima...@googlegroups.com
Thanks for your answers,

It wasn't clear to me that the creative was expected to be served through HTTPS.

I tried the examples on the repo provided and ran into other issues:
* The videoAd example triggers the error "missing functions getAdRemainingTime":
I don't think this method is part of the official VPAID spec.

Anyway, I added it, now the loader triggers another (less explicit) error: "Uncaught SyntaxError: Unexpected token m". See example here:

Thanks for your help,
Denis

Bret McGowen

unread,
Mar 17, 2015, 6:56:15 PM3/17/15
to ima...@googlegroups.com
Hey Denis,

Do you have a test page I can see the error on? I can't test the VAST ad tag you posted due to crossdomain security.

Thanks,
Bret McGowen
IMA SDK Team


Denis Vilar

unread,
Mar 18, 2015, 6:29:11 PM3/18/15
to ima...@googlegroups.com
I was simply using the video suite inspector here:

Bret McGowen

unread,
Mar 25, 2015, 1:19:04 AM3/25/15
to ima...@googlegroups.com
Hey Denis,

After poking around your sample VPAID, it looks like a an error with the JSON parsing in your VPAID code. Specifically, when it parses the AdParameters:

    // Parse the incoming parameters.
    this.parameters_ = JSON.parse(creativeData['AdParameters']);


That JSON parser wants all name/values to be surrounded with double quotes. So if I update the AdParameter value in the VAST response to the following, it works:

<AdParameters>
   <![CDATA[
    {"videos" : [{"mimetype": "video/mp4", "url" : "https://vjs.zencdn.net/v/oceans.mp4"}]}
    ]]>
</AdParameters>


So updating your VAST with the above values and/or doing a JSON format check in the VPAID ad code should keep the error away.


Cheers,
Bret McGowen
IMA SDK Team

Reply all
Reply to author
Forward
0 new messages