diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 72a6939..9dfb9d3 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -104,6 +104,7 @@ dependencies { implementation("io.coil-kt:coil-gif:2.7.0") implementation("io.coil-kt:coil-video:2.7.0") implementation("androidx.media3:media3-exoplayer:1.4.1") + implementation("androidx.media3:media3-ui:1.4.1") implementation("androidx.media3:media3-datasource:1.4.1") implementation("androidx.media3:media3-datasource-okhttp:1.4.1") implementation("androidx.camera:camera-core:1.4.2") diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 73912d3..a0946b9 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -9,6 +9,7 @@ - VideoView(context).apply { - setVideoPath(url) - setOnPreparedListener { player -> - player.isLooping = true - player.setVolume(0f, 0f) - start() - } + PlayerView(context).apply { + useController = false + resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM + this.player = player } }, modifier = Modifier .size(220.dp) .clip(CircleShape), update = { view -> - if (!view.isPlaying) { - runCatching { view.start() } - } + view.player = player }, ) Text(stringResource(id = R.string.chat_circle_video), style = MaterialTheme.typography.labelSmall)