AbedElazizShe / LightCompressor

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

isStreamable adds "_temp" suffix and file not found. #178

Open waterdrake opened 1 year ago

waterdrake commented 1 year ago

I noticed that in onSuccess() of compression the String path that is returned has _temp appended to it if isStreamable is set to true. This is the code that does that:

private fun validatedFileName(name: String, isStreamable: Boolean?): String {
        val videoName = if (isStreamable == null || !isStreamable) name
        else "${name}_temp"

        if (!videoName.contains("mp4")) return "${videoName}.mp4"
        return videoName
    }

I tried to then check if that file exists in onSuccess() and it does not.

What is the purpose of this _temp suffix? Perhaps it should be removed?