Class AdsMediaSource.AdLoadException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.io.IOException
-
- com.google.android.exoplayer2.source.ads.AdsMediaSource.AdLoadException
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- AdsMediaSource
public static final class AdsMediaSource.AdLoadException extends IOException
Wrapper for exceptions that occur while loading ads, which are notified viaMediaSourceEventListener.onLoadError(int, MediaPeriodId, LoadEventInfo, MediaLoadData, IOException, boolean).- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAdsMediaSource.AdLoadException.TypeTypes of ad load exceptions.
-
Field Summary
Fields Modifier and Type Field Description @com.google.android.exoplayer2.source.ads.AdsMediaSource.AdLoadException.Type inttypeTheAdsMediaSource.AdLoadException.Typeof the ad load exception.static intTYPE_ADType for when an ad failed to load.static intTYPE_AD_GROUPType for when an ad group failed to load.static intTYPE_ALL_ADSType for when all ad groups failed to load.static intTYPE_UNEXPECTEDType for when an unexpected error occurred while loading ads.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AdsMediaSource.AdLoadExceptioncreateForAd(Exception error)Returns a new ad load exception ofTYPE_AD.static AdsMediaSource.AdLoadExceptioncreateForAdGroup(Exception error, int adGroupIndex)Returns a new ad load exception ofTYPE_AD_GROUP.static AdsMediaSource.AdLoadExceptioncreateForAllAds(Exception error)Returns a new ad load exception ofTYPE_ALL_ADS.static AdsMediaSource.AdLoadExceptioncreateForUnexpected(RuntimeException error)Returns a new ad load exception ofTYPE_UNEXPECTED.RuntimeExceptiongetRuntimeExceptionForUnexpected()Returns theRuntimeExceptionthat caused the exception if its type isTYPE_UNEXPECTED.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
TYPE_AD
public static final int TYPE_AD
Type for when an ad failed to load. The ad will be skipped.- See Also:
- Constant Field Values
-
TYPE_AD_GROUP
public static final int TYPE_AD_GROUP
Type for when an ad group failed to load. The ad group will be skipped.- See Also:
- Constant Field Values
-
TYPE_ALL_ADS
public static final int TYPE_ALL_ADS
Type for when all ad groups failed to load. All ads will be skipped.- See Also:
- Constant Field Values
-
TYPE_UNEXPECTED
public static final int TYPE_UNEXPECTED
Type for when an unexpected error occurred while loading ads. All ads will be skipped.- See Also:
- Constant Field Values
-
type
public final @com.google.android.exoplayer2.source.ads.AdsMediaSource.AdLoadException.Type int type
TheAdsMediaSource.AdLoadException.Typeof the ad load exception.
-
-
Method Detail
-
createForAd
public static AdsMediaSource.AdLoadException createForAd(Exception error)
Returns a new ad load exception ofTYPE_AD.
-
createForAdGroup
public static AdsMediaSource.AdLoadException createForAdGroup(Exception error, int adGroupIndex)
Returns a new ad load exception ofTYPE_AD_GROUP.
-
createForAllAds
public static AdsMediaSource.AdLoadException createForAllAds(Exception error)
Returns a new ad load exception ofTYPE_ALL_ADS.
-
createForUnexpected
public static AdsMediaSource.AdLoadException createForUnexpected(RuntimeException error)
Returns a new ad load exception ofTYPE_UNEXPECTED.
-
getRuntimeExceptionForUnexpected
public RuntimeException getRuntimeExceptionForUnexpected()
Returns theRuntimeExceptionthat caused the exception if its type isTYPE_UNEXPECTED.
-
-