How to load vast with xml, not uri

629 views
Skip to first unread message

吳炳輝

unread,
Aug 24, 2022, 11:08:47 AM8/24/22
to Interactive Media Ads SDK
Hello~
I want to load vast with xml, not uri
Does the IMA SDK provide any way for me to do this?

IMA SDK

unread,
Aug 25, 2022, 3:28:52 AM8/25/22
to antho...@aotter.net, ima...@googlegroups.com

Hello,

 

Michael here from IMA SDK Team. Thank you for reaching out to us.

 

I believe the only other way you can do other than using an ad tag url is by providing adsResponse in your adsRequest method. adsResponse lets you specify a VAST 2.0 document to be used as the ads response instead of making a request through an ad tag url. This can be useful for debugging and other situations where a VAST response is already available.

 

Let me know if this would fit to your use case.

Regards,

Google Logo
Michael Angelo
IMA SDK Team
 


ref:_00D1U1174p._5004Q2dnAaG:ref
Message has been deleted

吳炳輝

unread,
Aug 26, 2022, 7:11:15 AM8/26/22
to Interactive Media Ads SDK

So I can only use the way with advanced ?

Or I can use ImaAdsLoader object  to do this?
if yes, please provide me pseudo code, thanks !

IMA SDK

unread,
Aug 26, 2022, 12:01:32 PM8/26/22
to antho...@aotter.net, ima...@googlegroups.com
Hi Anthony,

In the simple sample I replaced
adsRequest.adTagUrl="{ad tag url placeholder}"; 

with

adsRequest.adsResponse= `{VAST placeholder}`;

The ad in the VAST played.

Regards,

Google Logo
Aryeh
IMA SDK Team
 


ref:_00D1U1174p._5004Q2dnAaG:ref

IMA SDK

unread,
Aug 26, 2022, 12:03:22 PM8/26/22
to ima...@googlegroups.com, antho...@aotter.net
Hi Anthony,

You may get all our samples for HTML5 client side here - https://github.com/googleads/googleads-ima-html5/releases and this should work in all our samples.

吳炳輝

unread,
Aug 26, 2022, 12:29:21 PM8/26/22
to Interactive Media Ads SDK

Android client side and using the ExoPlayer IMA extension

 The step  created a  MediaItem  object  and  set ads configuration with  adTagUri

MediaItem mediaItem =
        new MediaItem.Builder()
            .setUri(contentUri)
            .setAdsConfiguration(new MediaItem.AdsConfiguration.Builder(adTagUri).build())
            .build();

Is there any other way to set  VAST XML string source?

IMA SDK

unread,
Aug 26, 2022, 12:44:37 PM8/26/22
to antho...@aotter.net, ima...@googlegroups.com
Hi,

You may reach out to the issue tracker for Exoplayer with your request. Native IMA Android has public abstract void setAdsResponse (String cannedAdResponse).
Reply all
Reply to author
Forward
0 new messages