BetterVideoPlayer icon indicating copy to clipboard operation
BetterVideoPlayer copied to clipboard

Crash if the file name contains spaces

Open cylonu87 opened this issue 6 years ago • 1 comments

  • [x] I have verified there are no duplicate active or recent bugs, questions, or requests
  • [x] I have verified that I am using the latest version of Better Video Player.
  • [x] I have given my issue a non-generic title.
  • [x] I have read over the documentation (before asking questions on how to do something).
Include the following:
  • Better Video Player version: kotlin-SNAPSHOT
  • Device OS version: any
  • Device Manufacturer: any
  • Device Name: any
Reproduction Steps
  1. Execute this code:
mBetterVideoPlayer.setSource(Uri.fromFile(new File("/storage/sdcard/my video.mp4")));
Expected Result

The video to play.

Actual Result

A crash when trying to log the local URI:

java.util.MissingFormatArgumentException: Format specifier: 20v
	at java.util.Formatter.getArgument(Formatter.java:1111)
	at java.util.Formatter.doFormat(Formatter.java:1076)
	at java.util.Formatter.format(Formatter.java:1042)
	at java.util.Formatter.format(Formatter.java:1011)
	at java.lang.String.format(String.java:1999)
	at java.lang.String.format(String.java:1973)
	at com.halilibo.bvpkotlin.BetterVideoPlayer$Companion.log(BetterVideoPlayer.kt:1072)
	at com.halilibo.bvpkotlin.BetterVideoPlayer$Companion.access$log(BetterVideoPlayer.kt:1064)
	at com.halilibo.bvpkotlin.BetterVideoPlayer.prepare(BetterVideoPlayer.kt:480)
	at com.halilibo.bvpkotlin.BetterVideoPlayer.onSurfaceTextureAvailable(BetterVideoPlayer.kt:750)

If I rename the files without spaces, the video can play.

cylonu87 avatar Feb 21 '19 09:02 cylonu87

I found a temp solution, it's to remove the log with a proguard rule:

-assumenosideeffects class com.halilibo.bvpkotlin.BetterVideoPlayer$Companion {
    private void log(...);
 }

cylonu87 avatar Feb 21 '19 18:02 cylonu87