LightCompressor: Video doesn't play on iOS or Mac after compress
I am using this library for one of my project and I discover one issue when i compress video using this library and try to play on iPhone or Safari browser.
Original video: https://drive.google.com/file/d/1MXmwkjxB8WKX6_Rf78JXZ1E6W4yg639a/view?usp=sharing Compressed video: https://drive.google.com/file/d/1zdX8gUgrEoGttWifHh_2JZP3hZqncSq7/view?usp=sharing
When we try to play this video in quick time player, It showing following error alert:
- LightCompressor version: 0.7.8
- Device: Nokia 6.1 Plus - 10.0
- Code:
val sourceFile = File(video.url)
val destinationFile =
File(context.cacheDir.absolutePath + "/" + sourceFile.name)
VideoCompressor.start(
srcPath = sourceFile.path,
destPath = destinationFile.path,
quality = VideoQuality.HIGH,
isMinBitRateEnabled = false,
listener = object : CompressionListener {
override fun onCancelled() {
if (isCancelled) return
isCancelled = true
emitter.onError(UnknownErrorException("Video compression process cancelled"))
emitter.onComplete()
}
override fun onFailure(failureMessage: String) {
VideoCompressor.cancel()
if (isCancelled) return
isCancelled = true
emitter.onError(UnknownErrorException(failureMessage))
emitter.onComplete()
}
override fun onProgress(percent: Float) {
//Do nothing
}
override fun onStart() {
//Do nothing
}
override fun onSuccess() {
if (isCancelled) return
compressedVideoMediaList.add(Video(destinationFile.path))
if (videoMediaList.size == compressedVideoMediaList.size) {
emitter.onNext(compressedVideoMediaList.toList())
emitter.onComplete()
}
}
},
)
@AbedElazizShe Can you please help me here to figure out this issue? Let me know if you need any other details from my end.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (6 by maintainers)
Issue fixed in version 0.8.1. Please let me know if you still have the issue. You can close the task if the problem is solved.