Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.

Crash if the file name contains spaces #87

Open
4 tasks done
cylonu87 opened this issue Feb 21, 2019 · 1 comment
Open
4 tasks done

Crash if the file name contains spaces #87

cylonu87 opened this issue Feb 21, 2019 · 1 comment

Comments

@cylonu87
Copy link

  • I have verified there are no duplicate active or recent bugs, questions, or requests
  • I have verified that I am using the latest version of Better Video Player.
  • I have given my issue a non-generic title.
  • 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
Copy link
Author

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(...);
 }

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

No branches or pull requests

1 participant