You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
VideoCompressor.start(
context = CoPilotApplication.application.applicationContext,
uris = listOf(uri),
isStreamable = true,
sharedStorageConfiguration =
SharedStorageConfiguration(
saveAt = SaveLocation.movies, // => default is movies
),
configureWith =
Configuration(
quality = VideoQuality.LOW,
isMinBitrateCheckEnabled = false,
// This needs to be different every time.
videoNames = listOf(UUID.randomUUID().toString())),
listener =
object : CompressionListener {
override fun onProgress(index: Int, percent: Float) {
// Nothing
}
override fun onStart(index: Int) {
// Nothing really.
}
override fun onSuccess(index: Int, size: Long, path: String?) {
Timber.d("File compressed successfully: $path, $size")
// Upload video.
analyticsRepository.logEvent(Event.Chat.VIDEO_SENT, null)
path?.let { addMediaViewModel.uploadVideo(File(path)) }
}
override fun onFailure(index: Int, failureMessage: String) {
Timber.e(failureMessage)
addMediaViewModel.error()
}
override fun onCancelled(index: Int) {
// Make UI changes, cleanup, etc.
Timber.e("compression has been cancelled")
addMediaViewModel.error()
}
},
)
When I added some print statements, I tell video compressor the video should be called 30758f51-8e0a-449c-a421-2268cd3953c1. It says, I've compressed video, and it's here /storage/emulated/0/Movies/30758f51-8e0a-449c-a421-2268cd3953c1_temp.mp4, but there is no such file there, it's /storage/emulated/0/Movies/30758f51-8e0a-449c-a421-2268cd3953c1.mp4 . I'm using version com.github.AbedElazizShe:LightCompressor:1.3.2 . Is this intended? How do I get around this?
The text was updated successfully, but these errors were encountered:
Hey @akrulec , I met with the same issue while using this library. I investigated some parts and found that if we give isStreamable=true, it adds _temp to the file name we have given. I just changed it to false and it worked perfectly. (I am using android 13 on my device)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This is how I use the video compressor:
When I added some print statements, I tell video compressor the video should be called 30758f51-8e0a-449c-a421-2268cd3953c1. It says, I've compressed video, and it's here /storage/emulated/0/Movies/30758f51-8e0a-449c-a421-2268cd3953c1_temp.mp4, but there is no such file there, it's /storage/emulated/0/Movies/30758f51-8e0a-449c-a421-2268cd3953c1.mp4 . I'm using version
com.github.AbedElazizShe:LightCompressor:1.3.2
. Is this intended? How do I get around this?The text was updated successfully, but these errors were encountered: