Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Exception: java.lang.IllegalArgumentException #89

Open
shan-lak opened this issue Sep 23, 2022 · 1 comment
Open

Fatal Exception: java.lang.IllegalArgumentException #89

shan-lak opened this issue Sep 23, 2022 · 1 comment

Comments

@shan-lak
Copy link

shan-lak commented Sep 23, 2022

Library crash on Android 10 devices when going to trim videos in production mode, but it work fine in development mode. Also, the video cannot play on trim video screen. Only show a black screen with a play button in android 10. But above android 10, this issue not happen in both development and production.
I'm using the following version.
'com.github.a914-gowtham:android-video-trimmer:1.7.3'

TrimVideo.activity(url)
.setTitle("")
.setCompressOption(CompressOption())
.setHideSeekBar(true)
.setTrimType(TrimType.MIN_MAX_DURATION)
.setMinToMax(1, 10) //seconds
.start(this,startForResult)

How can i solve this issue?

java.lang.IllegalArgumentException
android.media.MediaMetadataRetriever.setDataSource (MediaMetadataRetriever.java:85)
com.gowtham.library.ui.ActVideoTrimmer.getCompressionCmd (ActVideoTrimmer.java:552)
com.gowtham.library.ui.ActVideoTrimmer.trimVideo (ActVideoTrimmer.java:513)
com.gowtham.library.ui.ActVideoTrimmer.onOptionsItemSelected (ActVideoTrimmer.java:497)

@farukkyldzx
Copy link

Hi.

I discovered that android 9 and below devices have these issues. I found a solution by importing the project. here is my solution.

utils > fileUtils > getRealPath func

Cursor cursor = context.getContentResolver().query(uri,projection,nul,nul,nul);

change to

Cursor cursor = context.getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,projection,nul,nul,nul);

I checked it on different android versions, it works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants