Re: [IMA SDK HTML5] Error this.b.canPlayType is not a function (in mobile Safari/Firefox) Workd on Android Chrome

292 views
Skip to first unread message
Message has been deleted

Binny Patel (IMA SDK Team)

unread,
Sep 2, 2016, 4:46:24 PM9/2/16
to Interactive Media Ads SDK
Hi Marcel,

It seems to a network-related issue, where a certain script is being blocked from accessing the implementation. This might not supply necessary code, which may result in this error.

When testing with your page, I saw a CORS issue which further confirmed this hypothesis.

You can check to make sure that you properly handle CORS. Let us know if you continue to see the issue.

Thanks,
Binny Patel
IMA SDK Team

On Friday, September 2, 2016 at 3:16:25 PM UTC-4, DesertKing wrote:
Hello,

I have a confusing problem. I load an IMA SDK as a preloader for a game in fullscreen mode. This works fine on Android/Chrome but does not in Firefox and especially not on Iphones/Safari .
I have an button to click on before the ad starts. But the problem appears in the adsLoader.requestAds(adsRequest); first.

You can reproduce the issue by using Firefox and switch to mobile mode (user agent change to "iPhone" for example and use a lower screen res)

In Firefox with that setup I get "TypeError: this.b.canPlayType is not a function" also in Safari I guess.
In Android/Chrome or Chrome in Mobile mode it works fine. Any idea ?

Example:

Best Regards
Marcel
Message has been deleted

Spiele- Umsonst

unread,
Sep 7, 2016, 6:10:14 AM9/7/16
to ima...@googlegroups.com
Hello,

the Problem was not with a CORS. The problem was that I had no <video> element as I use it for Adsense For Games. And Safari needs one in this case otherwise you get the error. So I had to insert one element with no real video just to .play() it before the ad loads than it worked. 

Best Regards
Marcel

2016-09-06 18:54 GMT+02:00 <ima...@googlegroups.com>:
Hi Marcel,

I have tested your live page on iOS Safari, but I didn't see any this.b.canPlayType is not a function error. I'd suggest that you replace the Access-Control-Allow-Origin as shown below. 

Access-Control-Allow-Originhttp://imasdk.googleapis.com ....//  URL that is being blocked.


Access-Control-Allow-Credentialstrue

Let me know if you still see the issue.

Thanks,
Binny Patel
IMA SDK Team



On 09/02/16 17:25:39 spiele...@gmail.com wrote:
Hello,

maybe I don't get it but basically it doesn't seem to have any effect:

I added to the header of my site. Or am I wrong here on what to do?
Also it works in Chrome.. ?!?

Access-Control-Allow-Origin*


Access-Control-Allow-Credentialstrue

--
You received this message because you are subscribed to the Google Groups "Interactive Media Ads SDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ima-sdk+unsubscribe@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/ima-sdk.
For more options, visit https://groups.google.com/d/optout.

Binny Patel (IMA SDK Team)

unread,
Sep 7, 2016, 12:19:52 PM9/7/16
to Interactive Media Ads SDK
Hi Marcel

It seems that your issue has been resolved by adding the <video> element. The video element is required to play the ads, as the ad displaying in the ads container element is rendered on top the video content element. The video player is set on the video element, so the video element is required. Let me know if you are still seeing the issue.

Thanks,
Binny Patel
IMA SDK Team

Reply all
Reply to author
Forward
0 new messages