MediaItem.ClippingConfiguration.Builder


public final class MediaItem.ClippingConfiguration.Builder


Builder for ClippingConfiguration instances.

Summary

Public constructors

Creates a new instance with default values.

Public methods

MediaItem.ClippingConfiguration

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

MediaItem.ClippingProperties

This method is deprecated.

Use build instead.

MediaItem.ClippingConfiguration.Builder

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

MediaItem.ClippingConfiguration.Builder

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

MediaItem.ClippingConfiguration.Builder
@CanIgnoreReturnValue
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
@CanIgnoreReturnValue
setRelativeToLiveWindow(boolean relativeToLiveWindow)

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

MediaItem.ClippingConfiguration.Builder
@CanIgnoreReturnValue
setStartPositionMs(@IntRange(from = 0) 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
@UnstableApi
@CanIgnoreReturnValue
setStartPositionUs(@IntRange(from = 0) long startPositionUs)

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

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

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

Public constructors

Builder

public Builder()

Creates a new instance with default values.

Public methods

build

public MediaItem.ClippingConfiguration build()

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

buildClippingProperties

@UnstableApi
public MediaItem.ClippingProperties buildClippingProperties()

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 TIME_END_OF_SOURCE to end when playback reaches the end of media (Default: TIME_END_OF_SOURCE).

setEndPositionUs

@UnstableApi
@CanIgnoreReturnValue
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 TIME_END_OF_SOURCE to end when playback reaches the end of media (Default: TIME_END_OF_SOURCE).

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

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

setStartPositionMs

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

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

setStartPositionUs

@UnstableApi
@CanIgnoreReturnValue
public MediaItem.ClippingConfiguration.Builder setStartPositionUs(@IntRange(from = 0) long startPositionUs)

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

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