AbedElazizShe / LightCompressor

A powerful and easy-to-use video compression library for android uses MediaCodec API.
Apache License 2.0
491 stars 116 forks source link

Force compressing code to run in IO thread #171

Closed amrreda1995 closed 9 months ago

amrreda1995 commented 9 months ago

Firebase crashlytics reported that there's some ANR happens because of some block of code running in the main thread After Investigation, I found that the compressing library code uses EmptyCoroutineContext which is considered the app main thread This PR has small fix for this issue by providing the IO context for kotlin coroutines to force code to be run in the IO thread

AbedElazizShe commented 9 months ago

Thank you @amrreda1995