Problem with Picture In Picture on Android

67 views
Skip to first unread message

Nikolas Spiridakis

unread,
Mar 5, 2024, 8:19:28 PM3/5/24
to Google Mobile Ads SDK Developers
Hello we've got this weird issue with AdMob Interstitial ads on Android.

We have an app which has a list of videos on the main screen (activity). When the user clicks a video, it is determined if an Interstitial ad should be shown. In the case an ad loads, the user can close the ad and then a new activity is launched which plays the video. If the user clicks the PiP button, the player activity goes in Picture in Picture mode and the user can see the main activity with the video list while the video is still playing. The problem occurs when the user taps another video to play and it tries to show an Interstitial ad while the PiP activity is open. The ad, instead of showing in fullscreen, it opens in the player activity and thus inside the Picture in Picture window.
When we load the ad we pass the Main Activity context in the interstitialAd.load() call so it shouldn't open there.. Maybe it's because the PiP activity is considered in the top of the activity stack?

Any help is appreciated.
Thanks

Mobile Ads SDK Forum Advisor

unread,
Mar 6, 2024, 6:31:35 AM3/6/24
to 1nikol...@gmail.com, google-adm...@googlegroups.com
Hi,

As you mentioned that the interstitial ad is loading in PIP mode. It is an intended behavior when the PIP mode is active. It is possible to implement an approach where advertisements open in full screen mode even if they are initially playing in picture-in-picture (PIP) mode.

When an advertisement is about to load, it is indicative of a successful loading process. At this juncture, it is essential to ascertain whether PIP mode is enabled. If it is, a forceful exit/ close activity from PIP mode should be initiated, thereby ensuring that the advertisement plays in full screen mode. Subsequent to the completion of the advertisement, the video player can be utilized to play the video, and PIP mode can be re-enabled.

By employing this approach, advertisements will be displayed in full screen mode while the video player maintains its PIP mode functionality, ensuring a seamless user experience.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02rzi5J:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team


Reply all
Reply to author
Forward
0 new messages