# ClippingMediaSource.IllegalClippingException

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/source/ClippingMediaSource.java+class:androidx.media3.exoplayer.source.ClippingMediaSource.IllegalClippingException)

*** ** * ** ***


```
public final class ClippingMediaSource.IllegalClippingException extends IOException
```

<br />

|---|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||||
| ↳ | [kotlin.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) ||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) |||
|   |   | ↳ | [java.io.IOException](https://developer.android.com/reference/java/io/IOException.html) ||
|   |   |   | ↳ | [androidx.media3.exoplayer.source.ClippingMediaSource.IllegalClippingException](https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource.IllegalClippingException) |

*** ** * ** ***

Thrown when a `https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource` cannot clip its wrapped source.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/androidx/annotation/IntDef(value = ) public annotation https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource.IllegalClippingException.Reason` The reason clipping failed. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource.IllegalClippingException#REASON_INVALID_PERIOD_COUNT() = 0` The wrapped source doesn't consist of a single period. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource.IllegalClippingException#REASON_NOT_SEEKABLE_TO_START() = 1` The wrapped source is not seekable and a non-zero clipping start position was specified. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource.IllegalClippingException#REASON_START_EXCEEDS_END() = 2` The wrapped source ends before the specified clipping start position. |

| ### Public fields |
|---|---|
| `final int` | `@https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource.IllegalClippingException.Reason https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource.IllegalClippingException#reason()` The reason clipping failed. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource.IllegalClippingException#IllegalClippingException(int)( @https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource.IllegalClippingException.Reason int reason )` |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource.IllegalClippingException#IllegalClippingException(int,long,long)( @https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource.IllegalClippingException.Reason int reason, long startUs, long endUs )` |

### Inherited methods

From [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) `synchronized final void` `https://developer.android.com/reference/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable.html exception)` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#fillInStackTrace()()` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#getCause()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getLocalizedMessage()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getMessage()()` `StackTraceElement[]` `https://developer.android.com/reference/java/lang/Throwable.html#getStackTrace()()` `synchronized final Throwable[]` `https://developer.android.com/reference/java/lang/Throwable.html#getSuppressed()()` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#initCause(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable.html cause)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace()()` `void` `https://developer.android.com/reference/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[])(StackTraceElement[] stackTrace)` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#toString()()`

## Constants

### REASON_INVALID_PERIOD_COUNT

```
public static final int REASON_INVALID_PERIOD_COUNT = 0
```

The wrapped source doesn't consist of a single period.

### REASON_NOT_SEEKABLE_TO_START

```
public static final int REASON_NOT_SEEKABLE_TO_START = 1
```

The wrapped source is not seekable and a non-zero clipping start position was specified.

### REASON_START_EXCEEDS_END

```
public static final int REASON_START_EXCEEDS_END = 2
```

The wrapped source ends before the specified clipping start position.

## Public fields

### reason

```
@ClippingMediaSource.IllegalClippingException.Reason
public final int reason
```

The reason clipping failed.

## Public constructors

### IllegalClippingException

```
public IllegalClippingException(
    @ClippingMediaSource.IllegalClippingException.Reason int reason
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaSource.IllegalClippingException.Reason int reason` | The reason clipping failed. |

### IllegalClippingException

```
public IllegalClippingException(
    @ClippingMediaSource.IllegalClippingException.Reason int reason,
    long startUs,
    long endUs
)
```