public final class

AdsMediaSource.AdLoadException

extends java.io.IOException

 java.lang.Object

↳java.lang.Throwable

↳java.lang.Exception

↳java.io.IOException

↳androidx.media3.exoplayer.source.ads.AdsMediaSource.AdLoadException

Overview

Wrapper for exceptions that occur while loading ads, which are notified via MediaSourceEventListener.

Summary

Fields
public final inttype

The AdsMediaSource.AdLoadException.Type of the ad load exception.

public static final intTYPE_AD

Type for when an ad failed to load.

public static final intTYPE_AD_GROUP

Type for when an ad group failed to load.

public static final intTYPE_ALL_ADS

Type for when all ad groups failed to load.

public static final intTYPE_UNEXPECTED

Type for when an unexpected error occurred while loading ads.

Methods
public static AdsMediaSource.AdLoadExceptioncreateForAd(java.lang.Exception error)

Returns a new ad load exception of AdsMediaSource.AdLoadException.TYPE_AD.

public static AdsMediaSource.AdLoadExceptioncreateForAdGroup(java.lang.Exception error, int adGroupIndex)

Returns a new ad load exception of AdsMediaSource.AdLoadException.TYPE_AD_GROUP.

public static AdsMediaSource.AdLoadExceptioncreateForAllAds(java.lang.Exception error)

Returns a new ad load exception of AdsMediaSource.AdLoadException.TYPE_ALL_ADS.

public static AdsMediaSource.AdLoadExceptioncreateForUnexpected(java.lang.RuntimeException error)

Returns a new ad load exception of AdsMediaSource.AdLoadException.TYPE_UNEXPECTED.

public java.lang.RuntimeExceptiongetRuntimeExceptionForUnexpected()

Returns the java.lang.RuntimeException that caused the exception if its type is AdsMediaSource.AdLoadException.TYPE_UNEXPECTED.

from java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Fields

public static final int TYPE_AD

Type for when an ad failed to load. The ad will be skipped.

public static final int TYPE_AD_GROUP

Type for when an ad group failed to load. The ad group will be skipped.

public static final int TYPE_ALL_ADS

Type for when all ad groups failed to load. All ads will be skipped.

public static final int TYPE_UNEXPECTED

Type for when an unexpected error occurred while loading ads. All ads will be skipped.

public final int type

The AdsMediaSource.AdLoadException.Type of the ad load exception.

Methods

public static AdsMediaSource.AdLoadException createForAd(java.lang.Exception error)

Returns a new ad load exception of AdsMediaSource.AdLoadException.TYPE_AD.

public static AdsMediaSource.AdLoadException createForAdGroup(java.lang.Exception error, int adGroupIndex)

Returns a new ad load exception of AdsMediaSource.AdLoadException.TYPE_AD_GROUP.

public static AdsMediaSource.AdLoadException createForAllAds(java.lang.Exception error)

Returns a new ad load exception of AdsMediaSource.AdLoadException.TYPE_ALL_ADS.

public static AdsMediaSource.AdLoadException createForUnexpected(java.lang.RuntimeException error)

Returns a new ad load exception of AdsMediaSource.AdLoadException.TYPE_UNEXPECTED.

public java.lang.RuntimeException getRuntimeExceptionForUnexpected()

Returns the java.lang.RuntimeException that caused the exception if its type is AdsMediaSource.AdLoadException.TYPE_UNEXPECTED.