Skip to content

Commit 1e91431

Browse files
authored
Update recommended way of setting image duration (#202)
1 parent ec31b95 commit 1e91431

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

samples/media/video/src/main/java/com/example/platform/media/video/TransformerVideoComposition.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ class TransformerVideoComposition : Fragment() {
173173

174174
if (binding.imageChip.isChecked) {
175175
val image = EditedMediaItem.Builder(
176-
MediaItem.fromUri(URI_IMAGE),
176+
// Show the image for 3 seconds in the composition
177+
MediaItem.Builder().setUri(URI_IMAGE).setImageDurationMs(3_000).build(),
177178
)
178-
.setDurationUs(3_000_000) // Show the image for 3 seconds in the composition
179179
.setFrameRate(30)
180180
.build()
181181

0 commit comments

Comments
 (0)