I want to display thumbnails for a list of video files stored on external storage in my PhoneGap/Cordova application. Here's what I have so far:
Simple enough, but then how do I access that file with PhoneGap? I can't seem to find where in the API docs it explains accessing the internal storage system for your app's data. Furthermore, is there a better way to do this entirely in memory without writing to the file system? I wouldn't mind discarding the thumbnail after I'm finished with it. I don't expect them to be accessed often.
Any help would be appreciated. Thanks!
Update:
Apparently Android generates thumbnail files for the gallery already, but the file names are just IDs. I keep seeing references to a "thumbnail database" that links these IDs to the respective file, but I can't find information on how to access it. Can someone please help me with an example or some documentation?
If anyone is looking for an answer to a similar question, what I did in the end was this:
function pickFile(callback) {
var options = {
quality: 100,
destinationType: navigator.camera.DestinationType.FILE_URI,
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,
mediaType: navigator.camera.MediaType.VIDEO
}
function fail(error) {
alert(error);
}
navigator.camera.getPicture(callback, fail, options);
}
This is an option that was apparently added in PhoneGap 1.1.0, which allows you to request a file from the user's gallery in a platform independent way. It's not very intuitive to find in the documentation, and you can't dictate anything about the user interface, but it's better then nothing! I hope that helps someone coming here from Google.
Cheers!