a914-gowtham / android-video-trimmer

Helps to trim local videos with compress option on Android applications using Exoplayer 2 and FFmpeg.
Other
362 stars 115 forks source link

HOW TO USE THIS LIB WITHOUT PICKING VIDEO FROM GALLERY #90

Open Usman-Click opened 1 year ago

Usman-Click commented 1 year ago

Hi,

174700553-d5343fc5-4db6-47d4-bd30-c1d8dba698ab (1)

As you can see I'm already playing the video so i don't have to pick it from the gallery since i have everything that i need (i.e the path),

What i want to do is : i want to open the Trim Activity when i click on that image that I CIRCLED WITH WHITE COLOR

1

But get this error when i called ActivityResultLauncher

Fatal Exception: java.lang.NullPointerException Attempt to invoke interface method 'int android.database.Cursor.getColumnIndexOrThrow(java.lang.String)' on a null object reference com.gowtham.library.utils.FileUtils.getRealPath (FileUtils.java:26) com.gowtham.library.ui.ActVideoTrimmer.lambda$setDataInView$4$ActVideoTrimmer (ActVideoTrimmer.java:217) com.gowtham.library.ui.-$$Lambda$ActVideoTrimmer$oSNiy720JmS9xLvkSHcIMIc37rE.run (Unknown Source:2) java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)

DonMarv00 commented 8 months ago

You should download the library and add it to your project, then you could modify the code directly as you want

a914-gowtham commented 8 months ago

@Usman-Click you should pass video uri instead of file path

TrimVideo.activity(String.valueOf(videoUri))
          .setHideSeekBar(true)
          .start(this,startForResult);