googleads-ima-android icon indicating copy to clipboard operation
googleads-ima-android copied to clipboard

Is there any way to do the preloading of the preroll ad in the Exoplayer?

Open Anas-mirza912 opened this issue 2 years ago • 2 comments

I'm using the IMA ads Extension in ExoPlayer, and I'm facing an issue where ads take some time to load due to internet connectivity or other unforeseen circumstances. To ensure a bufferless video playback experience in Android, I want to precache the IMA ad from the VAST file. While ExoPlayer automatically loads and stores midroll ads in the cache, it doesn't have sufficient time to preload preroll ads. Is there a way to address this issue and precache preroll ads for smoother playback?

Anas-mirza912 avatar Jan 29 '24 07:01 Anas-mirza912

Hello @Anas-mirza912 ,

Based on the way the IMA extension handles ad loading this is not currently possible. See the IMA Android preloading guide's timing table. With preloading, IMA starts loading ads following AdsManager.init().

However, with the IMA extension, AdsManager.init() and AdsManager.start() are called directly after each other. See the extension code. I would recommend creating an issue on the ExoPlayer GitHub, explaining this, to see if there is a solution to allowing a call to .init() to start loading pre-roll ads before playback.

Thank you, Jackson IMA SDK team

Kiro705 avatar Jan 29 '24 16:01 Kiro705

Hi @Kiro705 I am getting this error after the ad is loaded.

Screenshot 2024-02-16 at 4 48 34 PM

here are the logs for more details.

I'm testing a preroll ad here with the preroll test uri, and I want to avoid increasing the timeout because it could hurt the user experience. Can you help me fix this?

Anas-mirza912 avatar Feb 16 '24 11:02 Anas-mirza912