From 1e914315c258e90a0f5866d37d87b2401c857d09 Mon Sep 17 00:00:00 2001 From: kim-vde <54320150+kim-vde@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:22:45 +0200 Subject: [PATCH] Update recommended way of setting image duration (#202) --- .../platform/media/video/TransformerVideoComposition.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/media/video/src/main/java/com/example/platform/media/video/TransformerVideoComposition.kt b/samples/media/video/src/main/java/com/example/platform/media/video/TransformerVideoComposition.kt index 14f2cf2c..18861948 100644 --- a/samples/media/video/src/main/java/com/example/platform/media/video/TransformerVideoComposition.kt +++ b/samples/media/video/src/main/java/com/example/platform/media/video/TransformerVideoComposition.kt @@ -173,9 +173,9 @@ class TransformerVideoComposition : Fragment() { if (binding.imageChip.isChecked) { val image = EditedMediaItem.Builder( - MediaItem.fromUri(URI_IMAGE), + // Show the image for 3 seconds in the composition + MediaItem.Builder().setUri(URI_IMAGE).setImageDurationMs(3_000).build(), ) - .setDurationUs(3_000_000) // Show the image for 3 seconds in the composition .setFrameRate(30) .build()