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

Minor issue, facing error if video file name contains '?' or '#' #92

Closed muthuvel2 closed 9 months ago

muthuvel2 commented 1 year ago

Hi,

Faced an issue with file name. If video file name contains character '#' getting the error below.

Issue Line 205 : ActVideoTimmer->setDataInView Fix : Instead of "uri = Uri.parse(path)" we can use "uri = Uri.fromFile(new File(path))" Sorry, faced some issue in raising PR, so couldn't do it.

Thank you

Error Stack: Caused by: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: uri has query and/or fragment, which are not supported. Did you call Uri.parse() on a string containing '?' or '#'? Use Uri.fromFile(new File(path)) to avoid this. at com.google.android.exoplayer2.upstream.FileDataSource.openLocalFile(FileDataSource.java:182) at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:108) at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258) at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84) at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1009) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)

a914-gowtham commented 9 months ago

should be fixed in the recent storage permission changes. @muthuvel2