[IMA SDK iOS] Airplay issues on ads

261 views
Skip to first unread message

Ouch Ouch

unread,
May 12, 2021, 7:00:30 PM5/12/21
to Interactive Media Ads SDK
Hi team, I have a couple of problems when casting to airplay with both client side ads and dai live streams

With client side ads after a "loaded event" the only event shown after is the "log event" for timeout. Also at some point it just pauses the main content and you got to resume manually.

With Dai live, after an ad starts the playblack just stops without any further error. On another project I have, AVPlayer fails with an error -11870.

IMA SDK

unread,
May 13, 2021, 10:56:11 AM5/13/21
to miguel...@gmail.com, ima...@googlegroups.com
Hi there,

Are you able to replicate this issue on our sample apps for IMA and DAI with minimum modification?

Regards,

Google Logo
Aryeh Baker
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HAVxC:ref

Ouch Ouch

unread,
May 13, 2021, 11:33:09 AM5/13/21
to Interactive Media Ads SDK
Yes, here's two samples one with client ads and one with dai live.
Archive.zip

Ouch Ouch

unread,
May 13, 2021, 12:16:01 PM5/13/21
to Interactive Media Ads SDK
Additional info regarding the client side ads problem.

The "loaded event" and the ad starts, however I'm not seeing the "ad start event", "first quartile", etc. The only event shown after that are a "log event" (with the timeout) and a "pause event". Btw is this "pause event" supposed to be there? It seems odd and messes up the metrics sometimes.

IMA SDK

unread,
May 13, 2021, 4:02:47 PM5/13/21
to miguel...@gmail.com, ima...@googlegroups.com
Hi there,

Thank you for the samples, I took them to my team to test and we will get back to to you as soon as possible. "log event" occurs when something goes wrong.

Ouch Ouch

unread,
Jun 8, 2021, 5:53:59 PM6/8/21
to Interactive Media Ads SDK
Is there any news on this?

IMA SDK

unread,
Jun 9, 2021, 12:26:37 AM6/9/21
to miguel...@gmail.com, ima...@googlegroups.com

Hi there,

 

I work with Aryeh.

 

I'm afraid we haven't got any feedback from the team yet. I will re-raised this issue to get something that could help you. I will update you once the team evaluated their findings.


Regards,
Google Logo
Michael Angelo Legaspi
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HAVxC:ref

IMA SDK

unread,
Dec 27, 2021, 4:48:24 AM12/27/21
to miguel...@gmail.com, ima...@googlegroups.com

Hello,

 

Hope you are doing well.

 

I just want to get back on this as the fix for this issue has already been released. Kindly update to the latest version of the SDK if you haven't done so, to resolved the issue.

 

Let us know should you have any other concern.

Regards,

Google Logo
Michael Angelo Legaspi
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HAVxC:ref

Gutenberg Neto

unread,
Jan 4, 2022, 12:18:26 PM1/4/22
to Interactive Media Ads SDK
Hello, I'm having the same issue. When connected to AirPlay, trying to load ads will fail, with the message: "VAST media file loading reached a timeout of 8 seconds." - this occurs after getting a "LOADED" event, and also happens if I increase the timeout.

Note that this occurs even when loading sample tags from https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/tags , and only when connected to AirPlay (local playback works as expected).

I made sure to use the latest version of the SDK (3.14.5) as per the message above from Michael, but unfortunately this does not seem to fix the problem for me.

IMA SDK

unread,
Jan 5, 2022, 12:24:48 AM1/5/22
to gute...@allmakebelieve.com, ima...@googlegroups.com
Hello,

The issue should have been fixed on the latest version of the SDK. Kindly update your SDK, then let us know if if the issue persists.

Regards,
Google Logo
Teejay Wennie Pimentel
IMA SDK Team
 

 

ref:_00D1U1174p._5004Q2HAVxC:ref

Gutenberg Neto

unread,
Jan 5, 2022, 5:29:34 AM1/5/22
to Interactive Media Ads SDK
Yes, this is still present in the IMA iOS SDK v3.14.5 for me.

Thanks,
Gutenberg

Miguel Hernandez

unread,
Jan 5, 2022, 1:21:58 PM1/5/22
to Interactive Media Ads SDK
Hi @Gutenberg, I manage to work around this, it was quite a bit of work/testing but I managed to make it work fine on airplay. I haven't tested the newest version (probably won't for the next couple months) but since you are having the same issue I'll share my approach here.

I had the same problem you described I could event watch the ad however the timeout always broke the playback. This happened because event though the loaded event was being triggered for some reason the start event wasn't. And it seems internally that is what stops IMA from throwing the timeout.

I tried a lot of stuff however what ended up working was creating a second AVPlayer exclusively for client ads. The setup is strait forward you just need to create a view the same size as the player you are using for you main content(mc), switch them when you need to show an ad, also remember to handle correctly when going to/from fullscreen. Once you have that comes the fun part, IMA syncs with your mc player to know when to display an ad so you need to override some of the ad avplayer methods for this.

In my case I created a new class which inherited from AVPlayer. You will need to know if you are playing an ad or the mc. Now which methods need an override? First the currentTime(), when the ad is playing you want to return the ad player's current time, when the mc is playing you want to return the mc player's current time. Now you want to override the addPeriodicTimeObserver, addBoundaryTimeObserver and removeTimeObserver. IMA uses this observers internally to check when to show an ad, so keep track of when the mc or ad is playing and add/remove the observers on the right player. Also just a note keep track of where the observers are being set, if you try to remove one from the wrong player you'll face a crash (I believe, or at least an error).

If you need any further help regarding this please let me know. And if you are gonna ask why does this approach works, I'm sorry to say tbh I don't remember. I found out 6 months ago why this had to be done but I forgot (shrug).

Hope this helps you.

IMA SDK

unread,
Jan 5, 2022, 10:24:54 PM1/5/22
to gute...@allmakebelieve.com, ima...@googlegroups.com

Hello Gutenberg,

 

Thank you for responding back to us.

 

Would you be able to share with us the screen recording of the behavior and the steps to reproduce the issue? It would also be great help to our investigation if you could share with us the sample project implementation that can replicate the said behavior.

@Miguel, thank you for sharing your inputs. Glad that your workaround works for you but we cannot confirm this as the issue is believed to be resolved in the latest version of the sdk.

We will provide more information after we have conducted another investigation once the requested details has been shared with us.

Regards,

Google Logo
Michael Angelo Legaspi
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HAVxC:ref
Reply all
Reply to author
Forward
0 new messages