Package com.google.android.exoplayer2

## Class MediaItem.ClippingConfiguration.Builder

- java.lang.Object
- - com.google.android.exoplayer2.MediaItem.ClippingConfiguration.Builder

- Enclosing class:
    MediaItem.ClippingConfiguration

      public static final class MediaItem.ClippingConfiguration.Builder
      extends Object

  Builder for `MediaItem.ClippingConfiguration` instances.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Builder()` | Creates a new instance with default values.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `MediaItem.ClippingConfiguration` | `build()` | Returns a `MediaItem.ClippingConfiguration` instance initialized with the values of this builder.
    `MediaItem.ClippingProperties` | `buildClippingProperties()` | Deprecated. Use `build()` instead.
    `MediaItem.ClippingConfiguration.Builder` | `setEndPositionMs​(long endPositionMs)` | Sets the optional end position in milliseconds which must be a value larger than or equal to zero, or `C.TIME_END_OF_SOURCE` to end when playback reaches the end of media (Default: `C.TIME_END_OF_SOURCE`).
    `MediaItem.ClippingConfiguration.Builder` | `setRelativeToDefaultPosition​(boolean relativeToDefaultPosition)` | Sets whether the start position and the end position are relative to the default position in the window (Default: `false`).
    `MediaItem.ClippingConfiguration.Builder` | `setRelativeToLiveWindow​(boolean relativeToLiveWindow)` | Sets whether the start/end positions should move with the live window for live streams.
    `MediaItem.ClippingConfiguration.Builder` | `setStartPositionMs​(long startPositionMs)` | Sets the optional start position in milliseconds which must be a value larger than or equal to zero (Default: 0).
    `MediaItem.ClippingConfiguration.Builder` | `setStartsAtKeyFrame​(boolean startsAtKeyFrame)` | Sets whether the start point is guaranteed to be a key frame.

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### Builder

          public Builder()

      Creates a new instance with default values.

  - ### Method Detail

    - #### setStartPositionMs

          @CanIgnoreReturnValue
          public MediaItem.ClippingConfiguration.Builder setStartPositionMs​(@IntRange(from=0L)
                                                                            long startPositionMs)

      Sets the optional start position in milliseconds which must be a value larger than or equal to zero (Default: 0).

    - #### setEndPositionMs

          @CanIgnoreReturnValue
          public MediaItem.ClippingConfiguration.Builder setEndPositionMs​(long endPositionMs)

      Sets the optional end position in milliseconds which must be a value larger than or equal to zero, or `C.TIME_END_OF_SOURCE` to end when playback reaches the end of media (Default: `C.TIME_END_OF_SOURCE`).

    - #### setRelativeToLiveWindow

          @CanIgnoreReturnValue
          public MediaItem.ClippingConfiguration.Builder setRelativeToLiveWindow​(boolean relativeToLiveWindow)

      Sets whether the start/end positions should move with the live window for live streams. If `false`, live streams end when playback reaches the end position in live window seen when the media is first loaded (Default: `false`).

    - #### setRelativeToDefaultPosition

          @CanIgnoreReturnValue
          public MediaItem.ClippingConfiguration.Builder setRelativeToDefaultPosition​(boolean relativeToDefaultPosition)

      Sets whether the start position and the end position are relative to the default position in the window (Default: `false`).

    - #### setStartsAtKeyFrame

          @CanIgnoreReturnValue
          public MediaItem.ClippingConfiguration.Builder setStartsAtKeyFrame​(boolean startsAtKeyFrame)

      Sets whether the start point is guaranteed to be a key frame. If `false`, the playback transition into the clip may not be seamless (Default: `false`).

    - #### build

          public MediaItem.ClippingConfiguration build()

      Returns a `MediaItem.ClippingConfiguration` instance initialized with the values of this builder.

    - #### buildClippingProperties

          @Deprecated
          public MediaItem.ClippingProperties buildClippingProperties()

      Deprecated.
      Use `build()` instead.