IMA SDK (iOS Swift)/Android to play pre-roll ads(Wrapper VAST 3.0) from local/custom server

973 views
Skip to first unread message

Test Fusioni

unread,
Dec 22, 2016, 7:11:53 AM12/22/16
to Interactive Media Ads SDK

Hi 
I am using IMA SDK (iOS Swift) to play pre-roll ads(Wrapper VAST 3.0)
I am getting following error in my log 
                                  "Unable to request ads from server due to network error.
and when i am using the url of this type -
its running fine.
So what is the problem with the first url?, Why i am getting the error ? where the response of the both url are same!!

Used IMA SDK version 3.3.1 in iOS

And same issue with android IMA SDK with V3... and logcat has following code

12-22 17:34:40.401 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/cr_Ime: ImeThread is enabled.
12-22 17:34:40.460 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp E/chromium: [ERROR:interface_registry.cc(104)] Failed to locate a binder for interface: autofill::mojom::PasswordManagerDriver
12-22 17:34:40.471 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 5602
12-22 17:34:41.033 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp E/chromium: [ERROR:interface_registry.cc(104)] Failed to locate a binder for interface: autofill::mojom::PasswordManagerDriver
12-22 17:34:41.110 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp W/chromium: [WARNING:web_contents_impl.cc(3524)] https://imasdk.googleapis.com/ ran insecure content from http://fusioniprojects.com/rnd/addpod/adpods.xml
12-22 17:34:41.122 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/chromium: [INFO:CONSOLE(315)] "Mixed Content: The page at 'https://imasdk.googleapis.com/native/sdkloader/native_sdk_v3.html?sdk_version=a.3.5.2&hl=en&wvr=2&app=com.google.ads.interactivemedia.v3.samples.videoplayerapp' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://fusioniprojects.com/rnd/addpod/adpods.xml'. This content should also be served over HTTPS.", source: https://imasdk.googleapis.com/native/core/3.24.0/native_bridge__en.js (315)
12-22 17:34:41.874 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/chromium: [INFO:CONSOLE(0)] "XMLHttpRequest cannot load http://fusioniprojects.com/rnd/addpod/adpods.xml. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://imasdk.googleapis.com' is therefore not allowed access.", source: https://imasdk.googleapis.com/native/sdkloader/native_sdk_v3.html?sdk_version=a.3.5.2&hl=en&wvr=2&app=com.google.ads.interactivemedia.v3.samples.videoplayerapp (0)
12-22 17:34:41.879 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp W/chromium: [WARNING:web_contents_impl.cc(3524)] https://imasdk.googleapis.com/ ran insecure content from http://fusioniprojects.com/rnd/addpod/adpods.xml
12-22 17:34:41.881 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/chromium: [INFO:CONSOLE(315)] "Mixed Content: The page at 'https://imasdk.googleapis.com/native/sdkloader/native_sdk_v3.html?sdk_version=a.3.5.2&hl=en&wvr=2&app=com.google.ads.interactivemedia.v3.samples.videoplayerapp' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://fusioniprojects.com/rnd/addpod/adpods.xml'. This content should also be served over HTTPS.", source: https://imasdk.googleapis.com/native/core/3.24.0/native_bridge__en.js (315)
12-22 17:34:42.583 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/chromium: [INFO:CONSOLE(0)] "XMLHttpRequest cannot load http://fusioniprojects.com/rnd/addpod/adpods.xml. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://imasdk.googleapis.com' is therefore not allowed access.", source: https://imasdk.googleapis.com/native/sdkloader/native_sdk_v3.html?sdk_version=a.3.5.2&hl=en&wvr=2&app=com.google.ads.interactivemedia.v3.samples.videoplayerapp (0)
12-22 17:34:42.610 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/ImaExample: Ad Error: Unable to request ads from server due to network error.
12-22 17:34:42.627 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp D/MediaPlayer: Couldn't open file on client side, trying server side
12-22 17:34:42.662 5602-5619/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/MediaHTTPConnection: proxyName: 0.0.0.0 0
12-22 17:34:43.230 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp D/MediaPlayer: getMetadata
12-22 17:34:43.498 5602-5929/com.google.ads.interactivemedia.v3.samples.videoplayerapp W/MediaPlayer: info/warning (3, 0)


I am using IMA sdk advance sample code from https://github.com/googleads/googleads-ima-android/releases v3

dependencies {
    compile 'com.google.ads.interactivemedia.v3:interactivemedia:3.5.2'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.google.android.gms:play-services-ads:10.0.1'
    compile 'com.google.android.gms:play-services-cast:10.0.1'
}

Please advice what's the issue and how to resolved this..
Thanks.

Vu Chau (IMA SDK Team)

unread,
Dec 22, 2016, 8:15:31 AM12/22/16
to Interactive Media Ads SDK
Hello,

This is a cross-origin-resource-sharing (CORS) problem, which is denying the IMA SDK the access to your local XML resource:
12-22 17:34:42.583 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/chromium: [INFO:CONSOLE(0)] "XMLHttpRequest cannot load http://fusioniprojects.com/rnd/addpod/adpods.xml. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://imasdk.googleapis.com' is therefore not allowed access.", source: https://imasdk.googleapis.com/native/sdkloader/native_sdk_v3.html?sdk_version=a.3.5.2&hl=en&wvr=2&app=com.google.ads.interactivemedia.v3.samples.videoplayerapp (0)
To rectify this, you need to enable CORS on your local server. Depending on the type of server you are using, you can find the instructions for doing so on this site

While you are at it, I would also recommend enabling HTTPS on your server, especially when you are serving wrapper/redirect ad tags. What happens is that if there is a protocol mismatch among your page, your tags, and the redirect tags, it will cause a separate security problem:
12-22 17:34:41.122 5602-5602/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/chromium: [INFO:CONSOLE(315)] "Mixed Content: The page at 'https://imasdk.googleapis.com/native/sdkloader/native_sdk_v3.html?sdk_version=a.3.5.2&hl=en&wvr=2&app=com.google.ads.interactivemedia.v3.samples.videoplayerapp' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://fusioniprojects.com/rnd/addpod/adpods.xml'. This content should also be served over HTTPS.", source: https://imasdk.googleapis.com/native/core/3.24.0/native_bridge__en.js (315)
Let me know if you have any questions,

Vu Chau
IMA SDK Team

Test Fusioni

unread,
Dec 23, 2016, 6:38:22 AM12/23/16
to Interactive Media Ads SDK
Hi,

I have updated my server file now it is playing only one ad. Second ad is not playing .

and LOGCAT is 

12-23 17:05:17.220 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/cr_Ime: ImeThread is enabled.
12-23 17:05:17.242 10623-10633/com.google.ads.interactivemedia.v3.samples.videoplayerapp W/art: Suspending all threads took: 5.634ms
12-23 17:05:17.275 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp E/chromium: [ERROR:interface_registry.cc(104)] Failed to locate a binder for interface: autofill::mojom::PasswordManagerDriver
12-23 17:05:17.288 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 10623
12-23 17:05:17.824 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp E/chromium: [ERROR:interface_registry.cc(104)] Failed to locate a binder for interface: autofill::mojom::PasswordManagerDriver
12-23 17:05:21.214 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp W/IMASDK: Invalid internal message, ignoring. Please make sure the Google IMA SDK library is up to date. Message: gmsg://afma.google.com/activityMonitor?type=getPageSignals&sid=2a792b09-27de-48fc-9c9e-850dbb0b709d&dt=1482492921199
12-23 17:05:21.274 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/ImaExample: Event: LOADED
12-23 17:05:21.439 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/ImaExample: Event: CONTENT_PAUSE_REQUESTED
12-23 17:05:21.467 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp D/MediaPlayer: Couldn't open file on client side, trying server side
12-23 17:05:21.472 10623-10643/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/MediaHTTPConnection: proxyName: 0.0.0.0 0
12-23 17:05:22.168 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp D/MediaPlayer: getMetadata
12-23 17:05:22.449 10623-10643/com.google.ads.interactivemedia.v3.samples.videoplayerapp W/MediaPlayer: info/warning (3, 0)
12-23 17:05:22.726 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/ImaExample: Event: STARTED
12-23 17:05:25.030 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/ImaExample: Event: FIRST_QUARTILE
12-23 17:05:27.541 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/ImaExample: Event: MIDPOINT
12-23 17:05:30.153 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/ImaExample: Event: THIRD_QUARTILE
12-23 17:05:32.547 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/ImaExample: Event: COMPLETED
12-23 17:05:32.582 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/ImaExample: Event: CONTENT_RESUME_REQUESTED
12-23 17:05:32.586 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp D/MediaPlayer: Couldn't open file on client side, trying server side
12-23 17:05:32.596 10623-11659/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/MediaHTTPConnection: proxyName: 0.0.0.0 0
12-23 17:05:32.627 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp D/SDK_DEBUG: Destroying NativeVideoDisplay
12-23 17:05:32.628 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/ImaExample: Event: ALL_ADS_COMPLETED
12-23 17:05:33.027 10623-10623/com.google.ads.interactivemedia.v3.samples.videoplayerapp D/MediaPlayer: getMetadata
12-23 17:05:33.418 10623-10648/com.google.ads.interactivemedia.v3.samples.videoplayerapp W/MediaPlayer: info/warning (3, 0)

Please advice whats the issue...
Thanks


fusioni...@gmail.com

unread,
Dec 23, 2016, 8:41:19 AM12/23/16
to Interactive Media Ads SDK
Hi Vu Chau...
Thanks for your response.
I have the same problems with iOS platform. # Error ("Unable to request ads from server due to network error.")
I have updated the same as you suggested,but its does not work for me...still I am getting same error.

Test Fusioni

unread,
Dec 26, 2016, 12:24:07 AM12/26/16
to Interactive Media Ads SDK
Hi Vu Chau,

I have updated myserver information as you suggested. Can you please check this.
I am still getting some issues on My Both platforms Android and iOS.

In Case of Android :-
Only one ad video play, But when i check response it always give two ad video.

I have pasted all logs from Logcat.

In Case of iOS: 
No ad video play and got error is mention in comments by one of my colleague.

Please suggest. 

Thanks 
Mahesh.


On Thursday, December 22, 2016 at 6:45:31 PM UTC+5:30, Vu Chau (IMA SDK Team) wrote:

Vu Chau (IMA SDK Team)

unread,
Dec 27, 2016, 11:20:34 AM12/27/16
to Interactive Media Ads SDK
Hi Mahest,

The new issue arises from the fact that the redirect VAST responses contain invalid VAST characters. I have removed a number of nodes in your redirect ad tag (https://s3.amazonaws.com/calkinsdigital.com/VAST/ad_102513845.xml), and the final result (https://chauduyphanvu.github.io/TestFusioni.xml) plays fine.

Let me know if you continue seeing the issues,

Vu Chau
IMA SDK Team

fusioni...@gmail.com

unread,
Dec 28, 2016, 9:10:46 AM12/28/16
to Interactive Media Ads SDK

Hi Vu Chau,

 When i am using this (https://chauduyphanvu.github.io/TestFusioni.xml), the iMA SDK working fine but when i am using this URL(https://fusioniprojects.com/rnd/addpod/vast.xml). It's not working and occur the error like 'Unable to request ads from server due to network error.'. let me know, where is the actual problem.

Vu Chau (IMA SDK Team)

unread,
Dec 28, 2016, 10:44:02 AM12/28/16
to Interactive Media Ads SDK
Hello,

It is a server setup issue. The VAST response is structurally correct - you can test that by feeding it to the setAdsResponse() call.

It looks like you have set up CORS, but the header value you entered might have been different. Try entering also http://imasdk.googleapis.com and https://imasdk.googleapis.com. You could also try a wildcard '*' just to see if there is an improvement.

If you request against your server, you can see the following in Android Studio's logcat:

12-28 10:14:12.406 19212-19212/com.google.ads.interactivemedia.v3.samples.videoplayerapp I/chromium: [INFO:CONSOLE(0)] "XMLHttpRequest cannot load https://fusioniprojects.com/rnd/addpod/vast.xml. The 'Access-Control-Allow-Origin' header has a value 'https://imasdk.googleapis.com' that is not equal to the supplied origin. Origin 'http://imasdk.googleapis.com' is therefore not allowed access.", source: http://imasdk.googleapis.com/native/sdkloader/native_sdk_v3.html?sdk_version=a.3.2.1&hl=en&wvr=2&app=com.google.ads.interactivemedia.v3.samples.videoplayerapp (0)

Vu Chau
IMA SDK Team 
Message has been deleted

Test Fusioni

unread,
Dec 29, 2016, 9:29:53 AM12/29/16
to Interactive Media Ads SDK
I am getting an strange behavior while playing  ad video from this custom url https://fusioniprojects.com/rnd/adspodsios/vast.xml
 I have circled with red color in image attached. Error occur only when tap to skip button of previous ad video. 
This behavior only on android platform. 



Thanks
Mahesh


Vu Chau (IMA SDK Team)

unread,
Dec 29, 2016, 10:55:18 AM12/29/16
to Interactive Media Ads SDK
Hi Mahesh,

That seems to be a sporadic issue, as I was unable to reproduce it here on my end. How often are you seeing it (on emulators or on device)? Does it only happen in landscape mode?

That said, I saw a couple of other similar issues which, after they are addressed, might fix the issue you are seeing. 

Vu Chau
IMA SDK Team

Test Fusioni

unread,
Dec 30, 2016, 6:44:50 AM12/30/16
to Interactive Media Ads SDK
Hi Vu Chau,

In iOS/Android both platform have same issue, As shown in images i have attached.
I am Attaching the screen shot of my Mob (both landscape and portrait mode)

 
app-debug.apk

Vu Chau (IMA SDK Team)

unread,
Jan 3, 2017, 11:31:17 AM1/3/17
to Interactive Media Ads SDK
Thanks. I'm able to reproduce the issue more reliably now, and have asked the rest of the team to investigate.

I'll update you when I have more information,

Vu Chau
IMA SDK Team

Test Fusioni

unread,
Jan 23, 2017, 2:25:04 AM1/23/17
to Interactive Media Ads SDK
Hello Vu Chau,

Any update?

Vu Chau (IMA SDK Team)

unread,
Jan 23, 2017, 9:50:47 AM1/23/17
to Interactive Media Ads SDK
Hello,

We don't have an update as of now, but the team has begun investigating the issue. It appears to be an issue with the backend that affects both Android and iOS SDK code.

Vu
Reply all
Reply to author
Forward
0 new messages