EditedMediaItemSequence.Builder


class EditedMediaItemSequence.Builder


A builder for instances of EditedMediaItemSequence.

Summary

Public constructors

Builder(editedMediaItems: Array<EditedMediaItem!>!)

Creates an instance.

Builder(editedMediaItems: (Mutable)List<EditedMediaItem!>!)

Public constructors

Builder

Builder(editedMediaItems: Array<EditedMediaItem!>!)

Creates an instance.

Builder

Builder(editedMediaItems: (Mutable)List<EditedMediaItem!>!)

Public functions

addGap

@CanIgnoreReturnValue
fun addGap(durationUs: Long): EditedMediaItemSequence.Builder!

Adds a gap to the sequence.

A gap is a period of time with no media.

If the gap is added at the start of the sequence, then force audio track or/and force video track flag must be set appropriately.

Parameters
durationUs: Long

The duration of the gap, in milliseconds.

Returns
EditedMediaItemSequence.Builder!

This builder, for convenience.

addItem

@CanIgnoreReturnValue
fun addItem(item: EditedMediaItem!): EditedMediaItemSequence.Builder!

Adds the item to the sequence.

Parameters
item: EditedMediaItem!

The EditedMediaItem to add.

Returns
EditedMediaItemSequence.Builder!

This builder, for convenience.

addItems

@CanIgnoreReturnValue
fun addItems(items: Array<EditedMediaItem!>!): EditedMediaItemSequence.Builder!

Adds the items to the sequence.

Parameters
items: Array<EditedMediaItem!>!

The EditedMediaItem instances to add.

Returns
EditedMediaItemSequence.Builder!

This builder, for convenience.

addItems

@CanIgnoreReturnValue
fun addItems(items: (Mutable)List<EditedMediaItem!>!): EditedMediaItemSequence.Builder!

Adds all the items in the list to the sequence.

Parameters
items: (Mutable)List<EditedMediaItem!>!

The list of EditedMediaItem instances to add.

Returns
EditedMediaItemSequence.Builder!

This builder, for convenience.

build

fun build(): EditedMediaItemSequence!

Builds the EditedMediaItemSequence.

There must be at least one item in the sequence.

experimentalSetForceAudioTrack

@CanIgnoreReturnValue
fun experimentalSetForceAudioTrack(forceAudioTrack: Boolean): EditedMediaItemSequence.Builder!

Forces silent audio in the sequence.

This flag is necessary when:

  • The first EditedMediaItem in the sequence does not contain audio, but subsequent items do.
  • The first item in the sequence is a gap and the subsequent media items contain audio.

If the flag is not set appropriately, then the export will fail.

If the first EditedMediaItem already contains audio, this flag has no effect.

The MIME type of the output's audio track can be set using setAudioMimeType. The sample rate and channel count can be set by passing relevant AudioProcessor instances to the Composition.

Forcing an audio track and requesting audio transmuxing are not allowed together because generating silence requires transcoding.

The default value is false.

This method is experimental and will be renamed or removed in a future release.

Parameters
forceAudioTrack: Boolean

Whether to force audio track.

experimentalSetForceVideoTrack

@CanIgnoreReturnValue
fun experimentalSetForceVideoTrack(forceVideoTrack: Boolean): EditedMediaItemSequence.Builder!

Forces blank frames in the sequence.

This flag is necessary when:

  • The first EditedMediaItem in the sequence does not contain video, but subsequent items do.
  • The first item in the sequence is a gap and the subsequent media items contain video.

If the flag is not set appropriately, then the export will fail.

If the first EditedMediaItem already contains video, this flag has no effect.

The MIME type of the output's video track can be set using setVideoMimeType.

The output resolution must be set using a Presentation effect on the .

Forcing a video track and requesting video transmuxing are not allowed together because generating blank frames requires transcoding.

The default value is false.

This method is experimental and will be renamed or removed in a future release.

Parameters
forceVideoTrack: Boolean

Whether to force video track.

setIsLooping

@CanIgnoreReturnValue
fun setIsLooping(isLooping: Boolean): EditedMediaItemSequence.Builder!

See isLooping.

Looping is false by default.

Parameters
isLooping: Boolean

Whether this sequence should loop.

Returns
EditedMediaItemSequence.Builder!

This builder, for convenience.