docs/doc/reference/com/google/android/exoplayer2/transformer/EditedMediaItem.Builder.html
Package com.google.android.exoplayer2.transformer
Enclosing class:EditedMediaItem
public static final classEditedMediaItem.Builderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
A builder for EditedMediaItem instances.
Constructors | Constructor | Description |
| --- | --- |
| Builder(MediaItem mediaItem) |
Creates an instance.
|
All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| EditedMediaItem | build() |
Builds an EditedMediaItem instance.
|
| EditedMediaItem.Builder | setDurationUs(long durationUs) |
Sets the duration of the output video in microseconds.
|
| EditedMediaItem.Builder | setEffects(Effects effects) |
Sets the Effects to apply to the MediaItem.
|
| EditedMediaItem.Builder | setFlattenForSlowMotion(boolean flattenForSlowMotion) |
Sets whether to flatten the MediaItem if it contains slow motion markers.
|
| EditedMediaItem.Builder | setFrameRate(int frameRate) |
Sets the frame rate of the output video in frames per second.
|
| EditedMediaItem.Builder | setRemoveAudio(boolean removeAudio) |
Sets whether to remove the audio from the MediaItem.
|
| EditedMediaItem.Builder | setRemoveVideo(boolean removeVideo) |
Sets whether to remove the video from the MediaItem.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public Builder([MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem)
Creates an instance.
For image inputs, the values passed into setRemoveAudio(boolean), setRemoveVideo(boolean) and setFlattenForSlowMotion(boolean) will be ignored.
Parameters:mediaItem - The MediaItem on which transformations are applied.
-
@CanIgnoreReturnValue
public[EditedMediaItem.Builder](EditedMediaItem.Builder.html "class in com.google.android.exoplayer2.transformer")setRemoveAudio(boolean removeAudio)
Sets whether to remove the audio from the MediaItem.
The default value is false.
The audio and video cannot both be removed because the output would not contain any samples.
Parameters:removeAudio - Whether to remove the audio.Returns:This builder.
-
@CanIgnoreReturnValue
public[EditedMediaItem.Builder](EditedMediaItem.Builder.html "class in com.google.android.exoplayer2.transformer")setRemoveVideo(boolean removeVideo)
Sets whether to remove the video from the MediaItem.
The default value is false.
The audio and video cannot both be removed because the output would not contain any samples.
Parameters:removeVideo - Whether to remove the video.Returns:This builder.
-
@CanIgnoreReturnValue
public[EditedMediaItem.Builder](EditedMediaItem.Builder.html "class in com.google.android.exoplayer2.transformer")setFlattenForSlowMotion(boolean flattenForSlowMotion)
Sets whether to flatten the MediaItem if it contains slow motion markers.
The default value is false.
See flattenForSlowMotion for more information about slow motion flattening.
If using an ExoPlayerAssetLoader.Factory with a provided MediaSource.Factory, make sure that Mp4Extractor.FLAG_READ_SEF_DATA is set on the Mp4Extractor used. Otherwise, the slow motion metadata will be ignored and the input won't be flattened.
Slow motion flattening is only supported when the Composition contains exactly one MediaItem.
Using slow motion flattening together with MediaItem.ClippingConfiguration is not supported yet.
Parameters:flattenForSlowMotion - Whether to flatten for slow motion.Returns:This builder.
-
@CanIgnoreReturnValue
public[EditedMediaItem.Builder](EditedMediaItem.Builder.html "class in com.google.android.exoplayer2.transformer")setDurationUs(long durationUs)
Sets the duration of the output video in microseconds.
This should be set for inputs that don't have an implicit duration (e.g. images). It will be ignored for inputs that do have an implicit duration (e.g. video).
No duration is set by default.
-
@CanIgnoreReturnValue
public[EditedMediaItem.Builder](EditedMediaItem.Builder.html "class in com.google.android.exoplayer2.transformer")setFrameRate(@IntRange(from=0L)
int frameRate)
Sets the frame rate of the output video in frames per second.
This should be set for inputs that don't have an implicit frame rate (e.g. images). It will be ignored for inputs that do have an implicit frame rate (e.g. video).
No frame rate is set by default.
-
@CanIgnoreReturnValue
public[EditedMediaItem.Builder](EditedMediaItem.Builder.html "class in com.google.android.exoplayer2.transformer")setEffects([Effects](Effects.html "class in com.google.android.exoplayer2.transformer")effects)
Sets the Effects to apply to the MediaItem.
The default value is Effects.EMPTY.
Parameters:effects - The Effects to apply.Returns:This builder.
-
public[EditedMediaItem](EditedMediaItem.html "class in com.google.android.exoplayer2.transformer")build()
Builds an EditedMediaItem instance.