Pass app context to the IMA SDK

Notes: this doesn't fix the current issue where the component containing the
ad overlay view leaks, but is good practice anyway.
PiperOrigin-RevId: 308582036
This commit is contained in:
andrewlewis 2020-04-27 10:27:31 +01:00 committed by Oliver Woodman
parent 49e5e66033
commit f052e89a8f

View File

@ -477,7 +477,9 @@ public final class ImaAdsLoader
adCallbacks = new ArrayList<>(/* initialCapacity= */ 1);
adDisplayContainer = imaFactory.createAdDisplayContainer();
adDisplayContainer.setPlayer(/* videoAdPlayer= */ this);
adsLoader = imaFactory.createAdsLoader(context, imaSdkSettings, adDisplayContainer);
adsLoader =
imaFactory.createAdsLoader(
context.getApplicationContext(), imaSdkSettings, adDisplayContainer);
adsLoader.addAdErrorListener(/* adErrorListener= */ this);
adsLoader.addAdsLoadedListener(/* adsLoadedListener= */ this);
fakeContentProgressElapsedRealtimeMs = C.TIME_UNSET;