photokandyStudios / PKVideoThumbnail

Video Thumbnailing Plugin for Android and iOS
MIT License
39 stars 38 forks source link

nil always returned when ios source file path begins with "/" #14

Open sebringj opened 8 years ago

sebringj commented 8 years ago

Within obtainURLForPath NSString *pathForResource = [self.commandDelegate pathForResource:path];

always is nil prepending "file://" or using "cdvfile://" to the path prior to calling this code will enable it to work as it skips this part.

tested on iphone 6s plus

kerrishotts commented 8 years ago

So, when not providing a uri scheme, the current expectation is that you want to load a file from the application bundle. As such, "file://" is not the assumed scheme; it must be explicitly declared. (As a consequence, "/path/to/file" and "file:///path/to/file" mean very different things -- the first is relative to the app's bundle and the latter is relative to the system root.)

If you are having a problem loading an asset from within the app bundle, please post some code that replicates the problem.

sebringj commented 8 years ago

Thanks, Kerri, for making this. The reason this is filed as a bug is because the previous behavior of this code base allowed for this to work. Once I updated this plugin, I found it not working as before and adding the "file://" in front allowed it to work as I expected.

jacobo3d commented 8 years ago

Hi, I'm having the same issue. Prepending file:// or cdvfile:// works on iOS, but it doesn't seem to be working on Android. It gives a file not found error, on that path. Any ideas? Thanks!