public final class

EditedMediaItemSequence

extends java.lang.Object

 java.lang.Object

↳androidx.media3.transformer.EditedMediaItemSequence

Gradle dependencies

compile group: 'androidx.media3', name: 'media3-transformer', version: '1.5.0-alpha01'

  • groupId: androidx.media3
  • artifactId: media3-transformer
  • version: 1.5.0-alpha01

Artifact androidx.media3:media3-transformer:1.5.0-alpha01 it located at Google repository (https://maven.google.com/)

Overview

A sequence of EditedMediaItem instances.

EditedMediaItem instances in a sequence don't overlap in time.

Summary

Fields
public final <any>editedMediaItems

The EditedMediaItem instances in the sequence.

public final booleanisLooping

Whether this sequence is looping.

Constructors
publicEditedMediaItemSequence(EditedMediaItem editedMediaItem, EditedMediaItem editedMediaItems[])

Creates a non-looping instance.

publicEditedMediaItemSequence(java.util.List<EditedMediaItem> editedMediaItems)

Creates a non-looping instance.

publicEditedMediaItemSequence(java.util.List<EditedMediaItem> editedMediaItems, boolean isLooping)

Creates an instance.

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

Fields

public final <any> editedMediaItems

The EditedMediaItem instances in the sequence.

This list must not be empty.

public final boolean isLooping

Whether this sequence is looping.

This value indicates whether to loop over the EditedMediaItem instances in this sequence until all the non-looping sequences in the Composition have ended.

A looping sequence ends at the same time as the longest non-looping sequence. This means that the last exported EditedMediaItem from a looping sequence can be only partially exported.

Constructors

public EditedMediaItemSequence(EditedMediaItem editedMediaItem, EditedMediaItem editedMediaItems[])

Creates a non-looping instance.

public EditedMediaItemSequence(java.util.List<EditedMediaItem> editedMediaItems)

Creates a non-looping instance.

public EditedMediaItemSequence(java.util.List<EditedMediaItem> editedMediaItems, boolean isLooping)

Creates an instance.

Parameters:

editedMediaItems: The EditedMediaItemSequence.editedMediaItems.
isLooping: Whether the sequence is looping.

Source

/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package androidx.media3.transformer;

import static androidx.media3.common.util.Assertions.checkArgument;

import androidx.media3.common.util.UnstableApi;
import com.google.common.collect.ImmutableList;
import java.util.List;

/**
 * A sequence of {@link EditedMediaItem} instances.
 *
 * <p>{@linkplain EditedMediaItem} instances in a sequence don't overlap in time.
 */
@UnstableApi
public final class EditedMediaItemSequence {

  /**
   * The {@link EditedMediaItem} instances in the sequence.
   *
   * <p>This list must not be empty.
   */
  public final ImmutableList<EditedMediaItem> editedMediaItems;

  /**
   * Whether this sequence is looping.
   *
   * <p>This value indicates whether to loop over the {@link EditedMediaItem} instances in this
   * sequence until all the non-looping sequences in the {@link Composition} have ended.
   *
   * <p>A looping sequence ends at the same time as the longest non-looping sequence. This means
   * that the last exported {@link EditedMediaItem} from a looping sequence can be only partially
   * exported.
   */
  public final boolean isLooping;

  /** Creates a {@linkplain #isLooping non-looping} instance. */
  public EditedMediaItemSequence(
      EditedMediaItem editedMediaItem, EditedMediaItem... editedMediaItems) {
    this(
        new ImmutableList.Builder<EditedMediaItem>()
            .add(editedMediaItem)
            .add(editedMediaItems)
            .build());
  }

  /** Creates a {@linkplain #isLooping non-looping} instance. */
  public EditedMediaItemSequence(List<EditedMediaItem> editedMediaItems) {
    this(editedMediaItems, /* isLooping= */ false);
  }

  /**
   * Creates an instance.
   *
   * @param editedMediaItems The {@link #editedMediaItems}.
   * @param isLooping Whether the sequence {@linkplain #isLooping is looping}.
   */
  public EditedMediaItemSequence(List<EditedMediaItem> editedMediaItems, boolean isLooping) {
    checkArgument(!editedMediaItems.isEmpty());
    this.editedMediaItems = ImmutableList.copyOf(editedMediaItems);
    this.isLooping = isLooping;
  }
}