Hello Aryeh,
We have tried the preloading implementation for the custom videoAdPlayer as shown in the documentation shared by you.
Posting the code snippets of the changes that were required to support preloading functionality.
From the documentation and implementation that was given for preLoading, I am assuming that loadAd, playAd methods will be called multiple times. Please let me know if my understanding is correct,
and the way we have implemented our code is correct or not, especially
stopAd method. Because in the documentation below implementation is given, but I didn't understand correctly what last 3 empty functions should exactly do.
I am pasting the logs that we have got by using the above-shared implementation.
2021-05-13 15:10:07.681 30515-30515/? E/ImaVideoPlayer: prepareAdManager: enablePreLogin: true
2021-05-13 15:10:07.720 30515-30515/? E/ImaVideoPlayer: onAdEvent: LOADED
2021-05-13 15:10:07.729 30515-30515/? E/ImaVideoPlayer: loadAd: com.google.ads.interactivemedia.v3.api.player.AdMediaInfo@85ac9c3
2021-05-13 15:10:12.765 30515-30515/? E/ImaVideoPlayer: onAdEvent: CONTENT_PAUSE_REQUESTED
2021-05-13 15:10:12.997 30515-30515/? E/ImaVideoPlayer: playAd: com.google.ads.interactivemedia.v3.api.player.AdMediaInfo@85ac9c3
2021-05-13 15:10:15.619 30515-30515/? E/ImaVideoPlayer: onAdEvent: STARTED
2021-05-13 15:10:15.636 30515-30515/? E/ImaVideoPlayer: onAdEvent: AdEvent[type=AD_PROGRESS, ...]
Also, we don't see any other log of loadAd or playAd, which means they are only called once. Are we missing something here? We had the assumption that they will be called multiple times and the ad would load faster.
But from the logs, we can see that the ad is taking 2.5seconds to show the first frame of the ad.
Thanks & Regards,
Mohit