Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to pre load preroll ads using ImaAdsLoader in a video list? #3636

Closed
alonaviram opened this issue Dec 24, 2017 · 1 comment
Closed
Assignees
Labels

Comments

@alonaviram
Copy link

alonaviram commented Dec 24, 2017

I see that in ImaAdsLoader there is a pre loading implementation, but it gets called only on onAdsManagerLoaded that gets called only after requesting ad (i think).
I want to pre request ads and when the user scroll to a video item show the preroll only if it's already loaded (and not wait for ad to download).
thanks!

@andrewlewis
Copy link
Collaborator

Call ImaAdsLoader.requestAds to request the ad tag before preparing the player

In case you want to play just the content if the ad tag hasn't loaded by the time you need to prepare the player: you could call ImaAdsLoader.getAdsLoader, attach your own AdsLoadedListener and then handle onAdsManagerLoaded. At the time of preparing the player, if that method has been called you know to proceed with playback with ads. Otherwise you can prepare the player with a content media source and release the ads loader.

@google google locked and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants