I am trying to play video files that are packaged within a Cordova application. My goal is to transfer these files from the android_asset
folder to the SD card using the File API in JavaScript.
However, I am encountering difficulties in accessing this folder within the Cordova WebView.
Despite attempting various methods, I have yet to find a solution. Two approaches that should theoretically work are:
var url = 'file:///android_asset/www/my_video_folder';
var sourceDir = new DirectoryEntry( { fullPath: url } );
var reader = sourceDir.createReader();
reader.readEntries( success, error );
and
window.resolveLocalFileSystemURI(url, success, error);
In both cases, the error handling is triggered, with error.code == 5
(FileError.ENCODING_ERR
).
Could it be that my approach is simply not feasible? Do I need to resort to copying the files within the Java code?