IMA iOS SDK - Disable Airplay for in Ads?

165 views
Skip to first unread message

David Fairweather

unread,
Feb 22, 2021, 2:23:03 PM2/22/21
to Interactive Media Ads SDK
Hello,

My team and I have been trying to debug an issue where the ads will play via AirPlay even though our AVPlayer does not allow external playback and the user is connected to a device. However, when it does play like this, it will give me a 402 error similar to a conversation from a couple of years back https://groups.google.com/g/ima-sdk/c/nBXFmFU2OZI. Even when I increase the vastLoadTimeout, I will still get this error even though the current ad is playing just fine on the screen.

First question is where in the IMA SDK can I disable AirPlay for ads? Second question is how would I fix the request error in this situation?

I am testing on an iPhone 8 Plus with iOS 14.4
Currently using 'GoogleAds-IMA-iOS-SDK' v3.13.0

Thank you.

IMA SDK

unread,
Feb 22, 2021, 4:16:17 PM2/22/21
to davidfai...@odkmedia.net, ima...@googlegroups.com
Hi David,

Can you replicate this issue in our sample apps?

Regards,

Google Logo
Aryeh Baker
IMA SDK Team
 


ref:_00D1U1174p._5004Q2CTcTs:ref

David Fairweather

unread,
Feb 22, 2021, 4:57:14 PM2/22/21
to Interactive Media Ads SDK
Hi Aryeh,

I was able to reproduce this in the BasicExample app (Swift). To reproduce this, I have done the following:

1) Set contentPlayer.allowsExternalPlayback to false
2) Launch app
3) Accessed music widget and connect to nearby device via AirPlay
4) Played the video

As a result, the ad will play on the connected device and the player on the phone will have the ad overlay (Learn More button, Ad countdown). Once the ad is finished, the video will play on the phone as expected, but I notice the "Linear Inline" ad on the screen of the AirPlay device is still visible and stuck at the end of the ad's video (where it says Linear Inline: 1 second). I attached a screenshot of the phone's screen for reference.
BasicExampleScreenshot.png

IMA SDK

unread,
Feb 23, 2021, 12:20:25 AM2/23/21
to davidfai...@odkmedia.net, ima...@googlegroups.com

Hi there,

I’m with Aryeh’s team so let me assist you here. 

Since you’re also using the AirPlay feature of the device, could you kindly confirm if you’ve enabled the “Audio and AirPlay” background mode settings of your app as mentioned on our document?

As part of the implementation process, it is stated that to make background ad requests, your content must be playing. This may require manually calling play on the content player when the app enters the background before calling [IMAAdsLoader requestAds:].

Backgrounding an iOS app automatically pauses video playback. If your app is backgrounded while playing a video ad, you need to call [IMAAdsManager resume] to resume playback.


With these, It looks like the scenario that you are experiencing (stucked ad) seems to be working as expected if the above process is not being followed.

Kindly confirm and let us know if the above works for you.

 

Regards,



Google Logo
Sherwin Diesta
IMA SDK Team
 


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