Back to Exoplayer

AdsMediaSource.AdLoadException (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/ads/AdsMediaSource.AdLoadException.html

latest7.7 KB
Original Source

Package com.google.android.exoplayer2.source.ads

Class AdsMediaSource.AdLoadException


public static final classAdsMediaSource.AdLoadExceptionextends[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Wrapper for exceptions that occur while loading ads, which are notified via MediaSourceEventListener.onLoadError(int, MediaPeriodId, LoadEventInfo, MediaLoadData, IOException, boolean). See Also:Serialized Form

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static interface | AdsMediaSource.AdLoadException.Type | Types of ad load exceptions. |

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | @com.google.android.exoplayer2.source.ads.AdsMediaSource.AdLoadException.Type int | type | The AdsMediaSource.AdLoadException.Type of the ad load exception. | | static int | TYPE_AD | Type for when an ad failed to load. | | static int | TYPE_AD_GROUP | Type for when an ad group failed to load. | | static int | TYPE_ALL_ADS | Type for when all ad groups failed to load. | | static int | TYPE_UNEXPECTED | Type 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.AdLoadException | createForAd​(Exception error) | Returns a new ad load exception of TYPE_AD. | | static AdsMediaSource.AdLoadException | createForAdGroup​(Exception error, int adGroupIndex) | Returns a new ad load exception of TYPE_AD_GROUP. | | static AdsMediaSource.AdLoadException | createForAllAds​(Exception error) | Returns a new ad load exception of TYPE_ALL_ADS. | | static AdsMediaSource.AdLoadException | createForUnexpected​(RuntimeException error) | Returns a new ad load exception of TYPE_UNEXPECTED. | | RuntimeException | getRuntimeExceptionForUnexpected() | Returns the RuntimeException that caused the exception if its type is TYPE_UNEXPECTED. |

- 

Methods inherited from class java.lang.Throwable

addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

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

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

Method Detail

- 

createForAd

public static[AdsMediaSource.AdLoadException](AdsMediaSource.AdLoadException.html "class in com.google.android.exoplayer2.source.ads")createForAd​([Exception](https://developer.android.com/reference/java/lang/Exception.html "class or interface in java.lang")error)

Returns a new ad load exception of TYPE_AD.

- 

createForAdGroup

public static[AdsMediaSource.AdLoadException](AdsMediaSource.AdLoadException.html "class in com.google.android.exoplayer2.source.ads")createForAdGroup​([Exception](https://developer.android.com/reference/java/lang/Exception.html "class or interface in java.lang")error,
                                                              int adGroupIndex)

Returns a new ad load exception of TYPE_AD_GROUP.

- 

createForAllAds

public static[AdsMediaSource.AdLoadException](AdsMediaSource.AdLoadException.html "class in com.google.android.exoplayer2.source.ads")createForAllAds​([Exception](https://developer.android.com/reference/java/lang/Exception.html "class or interface in java.lang")error)

Returns a new ad load exception of TYPE_ALL_ADS.

- 

createForUnexpected

public static[AdsMediaSource.AdLoadException](AdsMediaSource.AdLoadException.html "class in com.google.android.exoplayer2.source.ads")createForUnexpected​([RuntimeException](https://developer.android.com/reference/java/lang/RuntimeException.html "class or interface in java.lang")error)

Returns a new ad load exception of TYPE_UNEXPECTED.

- 

getRuntimeExceptionForUnexpected

public[RuntimeException](https://developer.android.com/reference/java/lang/RuntimeException.html "class or interface in java.lang")getRuntimeExceptionForUnexpected()

Returns the RuntimeException that caused the exception if its type is TYPE_UNEXPECTED.