-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
Description
When a media source is created with a file containing hash character ('#') in filename, this file cannot be played back by ExoPlayer, as the URI Object will not provide full path in the function "uri.getPath()" used by FileDataSource.
Media source is created as follows:
MediaSource videoSource = new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(Uri.parse("/storage/emulated/0/Movies/Movie#01.mp4"));
then exception is thrown as follows:
2019-09-25 11:04:51.325 5322-5322/com.anonymous E/EventLogger: internalError [1.04, 0.00, window=0, period=0, loadError]
com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: java.io.FileNotFoundException: /storage/emulated/0/Movies/Movie : open failed: ENOENT (No such file or directory)
at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:73)
at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:257)
at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:938)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:394)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.io.FileNotFoundException: /storage/emulated/0/Movies/Movie : open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:485)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:288)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:151)
at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:65)
at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:257)
at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:938)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:394)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Linux.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:210)
at libcore.io.IoBridge.open(IoBridge.java:471)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:288)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:151)
at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:65)
at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:257)
at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:938)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:394)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Can this be fixed by ExoPlayer or should I avoid filenames having "# character?
Reactions are currently unavailable