Rich Media Creative video ads auto play audio and keep playing while scrolling tableview cell

180 views
Skip to first unread message

Shubhendu shukla

unread,
Jul 8, 2020, 12:09:28 PM7/8/20
to Google Mobile Ads SDK Developers
Hi Team, 

I am showing DFPBannerView as one of my table view cell which shows an ad. These ads are of HTML rich media type. And also have used google mediation for showing Facebook ads.
Ideally when the app receives ad and comes in screen than video should be played automatically and audio needs to be muted. Now if the user unmutes the video ad and scrolls the Tableview then the video should be paused.

Right now what's happening is that in Android if works perfectly well but in case of iOS video does not autoplay and when the user plays the video and scrolls its keeps on playing with audio.

I have tried the below code in iOS swift.

GADMobileAds.sharedInstance().applicationMuted = true
Still, nothing happens. Followed instructions as per this link - Google Ads iOS Link 

I am also attaching the screenshot but for confidentiality reasons cannot share the code. 

Please help me.
ad.png

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 8, 2020, 1:59:06 PM7/8/20
to shubhe...@gmail.com, google-adm...@googlegroups.com

Hi Shubhendu,

Thank you for bringing this banner ads not autoplaying and continuing to play when off screen in iOS to our attention. In order to resolve this, we will try to replicate these issues in our sample apps - BannerTableViewExample by updating the info.plist as described here - https://developers.google.com/ad-manager/mobile-ads-sdk/ios/quick-start#update_your_infoplist and getting rid of the GADApplicationIdentifier key if it's there and in the TableViewController.swift file we will change GADBannerView to DFPBannerView and adUnitID with your ad unit Id and adding the facebook adaptor. Could you send via "Reply privately to author" your ad unit Id affected so we can test on our end?

Kind regards,
Aryeh Baker
Mobile Ads SDK Team



ref:_00D1U1174p._5004Q21k8TW:ref

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 13, 2020, 4:58:03 PM7/13/20
to shubhe...@gmail.com, google-adm...@googlegroups.com
Hi Shubhendu,

Thank you for sending me the working app that display the issue. I compiled and ran the app on an iPhone 8 plus and here are my findings:
  • When the app starts and video isn't yet visible the sound starts.
  • The sounds continues for little bit.
  • When video comes in view it appears that the video stopped a little bit into the timeline. 
  • Video never stops playing when out of view
  • error in Xcode shows like this a couple of times over:

2020-07-13 15:30:48.731837-0400 BannerTableViewExample[484:87273] [assertion] Error acquiring assertion: <NSError: 0x282ed5890; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {

    userInfo = {

        RBSAssertionAttribute = <RBSLegacyAttribute: 0x12fa42cb0; requestedReason: MediaPlayback; reason: MediaPlayback; flags: PreventTaskSuspend | PreventTaskThrottleDown | WantsForegroundResourcePriority>;

    }

}

2020-07-13 15:30:48.731893-0400 BannerTableViewExample[484:87273] [ProcessSuspension]  0x10c9f87a8 - ProcessAssertion() PID 484 Unable to acquire assertion for process with PID 484

2020-07-13 15:30:48.731931-0400 BannerTableViewExample[484:87038] [ProcessSuspension] 0x10c9f87a8 - ProcessAssertion::processAssertionWasInvalidated()

2

I looked around the web and this error is a common error in WKWebView as seen from here - https://developer.apple.com/forums/thread/127734. You can google "PreventTaskSuspend | PreventTaskThrottleDown | WantsForegroundResourcePriority" and see the many issues with gaining rights to autoplay in a browser view that Apple offers.

The findings in behavior and error messages tells us that the balance of evidence is that this creative isn't compatible as it is with iOS. Creatives issues are out of scope of this forum because we only support implementing the Mobile Ads SDK into apps.

With that being said, you may want to create Creatives using Google Templates with this studio described here - https://support.google.com/richmedia/#topic=4455749n and this article - https://support.google.com/richmedia/answer/2672553?hl=en&ref_topic=2672541 may help with properly building creatives. Another article describes the correct .JS code to make sure ad is visible to play if using the Studio here - https://support.google.com/richmedia/answer/2672554?hl=en&ref_topic=2672541. I also found a stackoverflow article about autoplay in iOS here - https://stackoverflow.com/questions/46483001/programmatically-play-video-with-sound-on-safari-and-mobile-chrome.

A more actionable alternative is to reach out to the maker of the creative to find out what they're expecting the creative would be compatible with.



Kind regards,
Aryeh Baker
Mobile Ads SDK Team



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