Skip to content

Why Composition buildUpon() method is package-private? #2814

@muhammad-najam-cmp

Description

@muhammad-najam-cmp

I’m working with Media3 Transformer (v1.7.1) along with Composition, and my use case is split into two parts:

  1. Preview / runtime playback – I use CompositionPlayer to preview video with basic overlays.
  2. Export / final output – I use Transformer to export video, but here I need to add additional values

The problem:

For preview, I build a Composition without heavy overlays.

For export, I would like to reuse the same Composition but extend it with extra overlays.

I noticed that Composition has a method:

/* package */ Builder buildUpon()

But it’s package-private, so I cannot call it.
This forces me to rebuild the Composition completely for export, which duplicates logic and is error-prone.

I also confirmed that the preview Composition works fine with Transformer, but since it doesn’t contain the extra overlays, the export misses them.

Question

Is there a recommended way to:

  1. Reuse an existing Composition for export,
  2. Add or modify only the overlays/effects,
  3. Without fully reconstructing the Composition?

Or is there a plan to make buildUpon() (or a similar API) public so that developers can safely clone and extend an existing Composition?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions