public final class

MediaItem.ClippingConfiguration.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media3.common.MediaItem.ClippingConfiguration.Builder

Overview

Builder for MediaItem.ClippingConfiguration instances.

Summary

Constructors
publicBuilder()

Creates a new instance with default values.

Methods
public MediaItem.ClippingConfigurationbuild()

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

public MediaItem.ClippingPropertiesbuildClippingProperties()

public MediaItem.ClippingConfiguration.BuildersetEndPositionMs(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).

public MediaItem.ClippingConfiguration.BuildersetEndPositionUs(long endPositionUs)

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).

public MediaItem.ClippingConfiguration.BuildersetRelativeToDefaultPosition(boolean relativeToDefaultPosition)

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

public MediaItem.ClippingConfiguration.BuildersetRelativeToLiveWindow(boolean relativeToLiveWindow)

Sets whether the start/end positions should move with the live window for live streams.

public MediaItem.ClippingConfiguration.BuildersetStartPositionMs(long startPositionMs)

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

public MediaItem.ClippingConfiguration.BuildersetStartPositionUs(long startPositionUs)

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

public MediaItem.ClippingConfiguration.BuildersetStartsAtKeyFrame(boolean startsAtKeyFrame)

Sets whether the start point is guaranteed to be a key frame.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Creates a new instance with default values.

Methods

public 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).

public MediaItem.ClippingConfiguration.Builder setStartPositionUs(long startPositionUs)

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

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).

public MediaItem.ClippingConfiguration.Builder setEndPositionUs(long endPositionUs)

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).

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).

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).

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).

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

public MediaItem.ClippingProperties buildClippingProperties()

Deprecated: Use MediaItem.ClippingConfiguration.Builder.build() instead.