Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SdkImpl.initAdObjects invoked before PlayerWrapper.onPlayerReady causes "skippablevideo is not supported" error on mobile #633

Closed
gawhyte opened this issue Jun 1, 2018 · 6 comments
Assignees
Labels

Comments

@gawhyte
Copy link
Contributor

gawhyte commented Jun 1, 2018

I'm running into an issue on mobile: the dreaded AdError 1005: The provided ad type: skippablevideo is not supported

I found this very helpful: https://groups.google.com/forum/#!msg/ima-sdk/jYE6j4_YCko/m6HuIkM9uKMJ, except it wasn't working... Looking at code I thought opt_videoElement was being provided to google.ima.AdDisplayContainer(containerElement, opt_videoElement) in SdkImpl.initAdObjects. However, it turned out controller.getContentPlayer() was returning null because PlayerWrapper hadn't yet set its value so I was still getting the 1005 error.

I was able to solve this for myself by moving the initAdObjects call out of SdkImpls constructor and into PlayerWrapper.onPlayerReady handler.

My question is: am I doing something wrong, or is this a valid fix? I can submit my patch if it is.

@ypavlotsky
Copy link
Contributor

Could you provide an ad tag where you were seeing the error? Also, what mobile platforms where you getting the error on?

@gawhyte
Copy link
Contributor Author

gawhyte commented Jun 4, 2018

Sure! The tag that was creating the problem for me: https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/8749/Omniti&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=[referrer_url]&description_url=[description_url]&correlator=[timestamp]

I was able to recreate the issue on both Safari (iOS) and Chrome (Mac with dev tools' device/mobile view).

(Changes that fixed the issue for me: gawhyte@b182fc1)

@ypavlotsky
Copy link
Contributor

I'm still seeing the issue (even with the changes) in the Advanced Example and getting the skippable error.

@gawhyte
Copy link
Contributor Author

gawhyte commented Jun 4, 2018

I believe you'll also need to set disableCustomPlaybackForIOS10Plus: true in the IMA configuration options. (and possibly set playsinline on the video element too)

@ypavlotsky
Copy link
Contributor

Hey that worked for me! If you can submit your fix as a PR, we would greatly appreciate it.

@gawhyte
Copy link
Contributor Author

gawhyte commented Jun 6, 2018

PR is submitted!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants