Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gif playback is interrupted until next draw phase #2298

Closed
jns-codeworks opened this issue May 31, 2024 · 5 comments
Closed

Gif playback is interrupted until next draw phase #2298

jns-codeworks opened this issue May 31, 2024 · 5 comments

Comments

@jns-codeworks
Copy link

jns-codeworks commented May 31, 2024

Gif playback is stopped as soon as the draw phase is finished and starts again when the composable is redrawn.
I see this effect on coil 2.x and 3.x. on my device Xiaomi Redmi Note 11s Android 14. Android emulator with the same api level is not affected.
Unfortunately I cannot reproduce when this effect occured for the first time, because gif playing used to work flawless.
However, I have the impression it might be coming from a compose update.

gif_playback.mp4
@jns-codeworks jns-codeworks changed the title Gif playback is interrupted until until next draw phase Gif playback is interrupted until next draw phase May 31, 2024
@colinrtwhite
Copy link
Member

Do you have a code snippit or project that reproduces the issue? You could also make changes to the sample:compose app in this repo. It's not possible to debug the issue without a way to reproduce it.

@jns-codeworks
Copy link
Author

It seems like LazyColumn is causing the issue, when it is added to a Column that contains an AsyncImage.
Still this issue effects my device only.
Compose version: 1.7.0-beta02

@Composable
private fun CoilGifTest() {
    val imageLoader = LocalContext.current.imageLoader 

    Surface {
        Column {
            AsyncImage(
                model = "https://gf-mint-website.s3.amazonaws.com/STAGE2/images/5077.gif",
                contentScale = ContentScale.Crop,
                contentDescription = null,
                imageLoader = imageLoader,
            )

            LazyColumn {
                for (idx in 0..10) {
                    item {
                        Box(
                            contentAlignment = Alignment.Center,
                            modifier = Modifier
                                .fillMaxWidth()
                                .height(80.dp)
                        ) {
                            Text("$idx")
                        }
                    }
                }
            }
        }
    }
}
gif_playback_2.mp4

@jns-codeworks
Copy link
Author

The same issue occurs when you add AsyncImage to a LazyColumn.

@jns-codeworks
Copy link
Author

When I'm using GifDecoder instead of AnimatedImageDecoder everything works fine

@colinrtwhite
Copy link
Member

Sorry I'm not able to reproduce this locally and can't debug without a way to reproduce this.

@colinrtwhite colinrtwhite closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants