-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File not Found but ... file exists #11
Comments
My mistake. Putting this stop giving this error. fileUri: 'file://mnt/sdcard/1/1.mp4', Now I have this other: "an error ocurred during transcoding" |
My mistake. outputFileName: 'gg.mp4', |
Hi! Happened to me too.. What can I do? Android 4.2.2. |
No you got to use the resolveLocalFileSystemURI. Just put ... The fullPath for the origin And only the name of the output (without fulPath) |
instructions unclear. Please enlighten me and put some working code here. what is the correct path for a file? //mnt/sdcard/123456.mp4' is not clear. I am using ionic and I have a file at file:///android_asset/www/img/smp12.mp4. And another one in the devices sd card root directory. I tried many options but all of them returned file not found exception. Can you elloborate the your file path solution. |
Cordova + platform Android
Line Code:
fileUri: currentEntries[file].fullPath
Error:
java.net.MalformedURLException: Protocol not found: /mt4p/VID_20150208_175451753.mp4
Edit Code:
fileUri: 'file://' + currentEntries[file].fullPath
Error:
java.io.FileNotFoundException
The file exist and doing console.log(currentEntries[file].fullPath); it says /mt4p/VID_20150208_175451753.mp4
Full code:
function getFileSystem(){
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSystem){ // success get file system
root = fileSystem.root;
listDir(root);
}, function(evt){ // error get file system
console.log("File System Error: "+evt.target.error.code);
}
);
}
function listDir(directoryEntry){
$('#files').empty();
$('#files').append('
if( !directoryEntry.isDirectory ) console.log('listDir incorrect type');
}
function openFolder(folder){
currentDir.getDirectory(currentEntries[folder].name, {create:false},
function(dir){ // success find directory
listDir(dir);
},
function(error){ // error find directory
console.log('Unable to find directory: '+error.code);
}
);
}
function openFile(file){
console.log(currentEntries[file].fullPath);
VideoEditor.transcodeVideo(
videoSuccess, // success cb
videoError, // error cb
{
fileUri: 'file://' + currentEntries[file].fullPath, // the path to the video on the device
outputFileName: 'file://mt4p/pepito.mp4', // the file name for the transcoded video
quality: VideoEditorOptions.Quality.MEDIUM_QUALITY,
outputFileType: VideoEditorOptions.OutputFileType.MPEG4,
optimizeForNetworkUse: VideoEditorOptions.OptimizeForNetworkUse.YES,
duration: 20 // optional, specify duration in seconds from start of video
}
);
}
AndroidManifest.xml
cordova plugins list
org.apache.cordova.file 1.3.3 "File"
org.apache.cordova.videoeditor 0.0.2 "VideoEditor"
The text was updated successfully, but these errors were encountered: