File tree Expand file tree Collapse file tree
libraries/exoplayer_ima/src/main/java/androidx/media3/exoplayer/ima Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141 * Bug fix: Corrected an issue where the ad MIME type did not match the
4242 MIME type provided in the IMA LOADED event. The fix now maps the ad MIME
4343 type using the ad pod index and ad position.
44+ * Add a null check before accessing result of ` getAdsManager() ` .
4445* Session:
4546 * Fix bug where stopping a ` MediaController ` connected to a platform
4647 session crashed the app if stop happened during ad playback
Original file line number Diff line number Diff line change @@ -1419,7 +1419,14 @@ private final class ComponentListener
14191419
14201420 @ Override
14211421 public void onAdsManagerLoaded (AdsManagerLoadedEvent adsManagerLoadedEvent ) {
1422- AdsManager adsManager = adsManagerLoadedEvent .getAdsManager ();
1422+ @ Nullable AdsManager adsManager = adsManagerLoadedEvent .getAdsManager ();
1423+ if (adsManager == null ) {
1424+ // The same AdsLoader may be used for both Client-side ads and SSAI ads at the same time.
1425+ // In this scenario, it may emit an `AdsManagerLoadedEvent` which should be handled by the
1426+ // `ImaServerSideAdInsertionMediaSource` instead of the `AdTagLoader`. It's safe to ignore
1427+ // that event.
1428+ return ;
1429+ }
14231430 if (!Objects .equals (pendingAdRequestContext , adsManagerLoadedEvent .getUserRequestContext ())) {
14241431 adsManager .destroy ();
14251432 return ;
You can’t perform that action at this time.
0 commit comments