googleads / googleads-mobile-flutter

A Flutter plugin for the Google Mobile Ads SDK
Apache License 2.0
325 stars 262 forks source link

BannerAd content gets swapped with video that is currently loading instead of the Ad on Android. #1064

Open alinchenescu opened 1 month ago

alinchenescu commented 1 month ago

Hello,

Im currently developing an app that has as a core feature a TikTok style infinity scroll for videos. Separated from this Widget I have a BannerAd,adaptive sticky banner, that is placed at the bottom of the screen.

[REQUIRED] Step 1: Describe your environment Im using google_mobile_ads: ^5.0.0. For the video playback im using video_player: 2.8.6 and the videos are preloaded using preload_page_view: ^0.2.0. Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.16.9, on macOS 14.0 23A344 darwin-arm64, locale en-RO) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.2) [✓] Connected device (3 available) [✓] Network resources

Plugin Version v5.0.0

[REQUIRED] Step 2: Describe the problem

ANDROID ONLY* The Problems I'm facing is that sometimes if the video feed is scrolled and the videos are not fully preloaded the Banner shows a stuck frame of the video that is loading for the feed instead of the Ad. Since video_player uses Exoplayer I assume that the banner does as well and for some reason the BannerAd mixes the Ad content with the video im loading. When the video finishes loading the banner goes back. The issue can be seen the the Screenshot bellow. Has anyover encountered something like this before or have any idea how to fix it? I have tried to use some other video players but their performance was not good enough for this use case.

Thanks a lot! image

malandr2 commented 1 month ago

Hey @alinchenescu, have you seen https://github.com/googleads/googleads-mobile-flutter/issues/1014? Any relation?

alinchenescu commented 1 month ago

Hey @alinchenescu, have you seen https://github.com/googleads/googleads-mobile-flutter/issues/1014? Any relation?

Doesn't seem to be related since I don't get the flicker and the result on my end is way different since the ads are the one affected and Im not using Webview.

malandr2 commented 1 month ago

@alinchenescu thanks, are you able to consistently reproduce this? Can you provide a minimum reproducible sample that we can use to troubleshoot?

malandr2 commented 3 weeks ago

Closing due to inactivity

alinchenescu commented 2 weeks ago

@malandr2 Hi, sorry for the late reply, I have managed to created a minimum reproducible sample, also i have noticed a few more things: -To replicate i think a video must be loading, during this time the Banner must also refresh and that is when the issue happens. -To replicate it is best to keep scrolling to always have a video loading while waiting for the Banner to refresh,using the test Ad seem to happen very rarely so it's a bit tricky but when using custom ads with refresh time set to the lowest the issue is very obvious.

Sample url: https://github.com/alinchenescu/video_ads_bugg