initAdsLoader

fun initAdsLoader(context: Context, adRequest: AdRequest?)

Creates the shared native IMA loader (wrapped by QPIMAAdsLoader) if it does not exist and, if adRequest is provided and no prefetch slot exists yet, immediately starts prefetching it via a fresh QPPrefetchAdsManager. An existing slot is kept as is; call deinitAdsLoader first to replace it.

Parameters

context

Any android.content.Context; the application context is used internally to avoid leaks.

playerView

The view used by the dedicated prefetch player to render the Pre-Roll.

adRequest

The Pre-Roll ad request to prefetch. Uses our SDK's existing AdRequest model.