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 was archived by the owner on Oct 10, 2024. It is now read-only.
@AbedElazizShe Hi, I have implemented this library and have the same error on the Xiaomi Redmi Note 11 only on one wmv format video.
This is my implementation.
val uris = listOf(uri)
VideoCompressor.start(
context = applicationContext,
uris = uris,
isStreamable = false,
appSpecificStorageConfiguration = AppSpecificStorageConfiguration(
subFolderName = "compressed-videos"
),
configureWith = Configuration(
videoNames = uris.map { uri -> uri.pathSegments.last() }, /*list of video names, the size should be similar to the passed uris*/
quality = VideoQuality.MEDIUM,
isMinBitrateCheckEnabled = true,
videoBitrateInMbps = 5,
),
listener = object : CompressionListener {
override fun onProgress(index: Int, percent: Float) {
Timber.d("Compression progress: $percent")
if (percent <= 100) {
setForegroundAsync(createCompressForegroundInfo(percent.toInt()))
}
}
override fun onStart(index: Int) {
Timber.d("Compression started: ${uri.path}")
setForegroundAsync(createCompressForegroundInfo(0))
}
override fun onSuccess(index: Int, size: Long, path: String?) {
Timber.d("Compressed video path: $path")
val compressedFile = File(path)
val intentUri = androidx.core.content.FileProvider.getUriForFile(
applicationContext,
applicationContext.packageName + ".provider",
compressedFile
)
onVideoCompressed.invoke(intentUri)
}
override fun onFailure(index: Int, failureMessage: String) {
Timber.d("Compression failed: $failureMessage")
onVideoCompressed.invoke(uri)
}
override fun onCancelled(index: Int) {
Timber.d("Compression cancelled")
onVideoCompressed.invoke(uri)
}
}
)
This is my stacktrace.
java.lang.SecurityException: Permission Denial: opening provider com.android.externalstorage.ExternalStorageProvider from ProcessRecord{1aff5d5 16162:com.opendrive.android/u0a461} (pid=16162, uid=10461) requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs
at android.os.Parcel.createExceptionOrNull(Parcel.java:2426)
at android.os.Parcel.createException(Parcel.java:2410)
at android.os.Parcel.readException(Parcel.java:2393)
at android.os.Parcel.readException(Parcel.java:2335)
at android.app.IActivityManager$Stub$Proxy.getContentProvider(IActivityManager.java:6097)
at android.app.ActivityThread.acquireProvider(ActivityThread.java:7415)
at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:3363)
at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:2529)
at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:2013)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1844)
at android.content.ContentResolver.openInputStream(ContentResolver.java:1520)
at com.abedelazizshe.lightcompressorlibrary.VideoCompressor.getMediaPath(VideoCompressor.kt:369)
at com.abedelazizshe.lightcompressorlibrary.VideoCompressor.access$getMediaPath(VideoCompressor.kt:27)
at com.abedelazizshe.lightcompressorlibrary.VideoCompressor$doVideoCompression$1$job$1.invokeSuspend(VideoCompressor.kt:113)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@2317590, Dispatchers.IO]
@AbedElazizShe Hi, I have implemented this library and have the same error on the Xiaomi Redmi Note 11 only on one wmv format video.
This is my implementation.
This is my stacktrace.