merri-ment opened a new issue #398:
URL: https://github.com/apache/cordova-plugin-file/issues/398
I am building an app using Cordova that generates mp4s using ffmpeg.js, the
output is a blob.
The blob is then written to disk using cordova-plugin-file.
The problem is i can't find the mp4 within the Camera Roll once downloaded.
The following code appears to run correctly, not throwing any errors and
reaching the onwriteend function. I am also confident the mp4 isn't corrupt.
let folderPath = Env.ios ? window.cordova.file.documentsDirectory :
window.cordova.file.externalDataDirectory
let filename = 'video.mp4'
window.resolveLocalFileSystemURL(folderPath, (dir) => {
console.log("got main dir", dir);
dir.getFile(filename, {
create: true
}, (file) => {
console.log("got the file", file);
file.createWriter(
(fileWriter) => {
fileWriter.onwriteend = function() {
console.log("onwriteend :: success writing
file");
};
fileWriter.onerror = function(err) {
alert("Unable to download");
console.error(err);
};
fileWriter.write(myVideoBlob);
},
(err) > {
// failed
alert("Unable to download");
console.error(err);
}
)
},
(err) => {
alert("Unable to download");
console.error(err);
}
);
},
(err) => {
alert("Unable to download");
console.error(err);
});
I have spent a fair amount of time googling this issue and reading the docs,
but i'm still not entirely sure if saving to the Camera Roll on ios is possible.
I'm using the following dependancies;
"cordova": "^9.0.0",
"cordova-android": "^8.1.0",
"cordova-ios": "^6.0.0",
"cordova-plugin-add-swift-support": "^2.0.2",
"cordova-plugin-android-permissions": "^1.0.2",
"cordova-plugin-androidx": "^2.0.0",
"cordova-plugin-androidx-adapter": "^1.1.1",
"cordova-plugin-apprate": "^1.5.0",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-firebasex": "^9.1.2-cli",
"cordova-plugin-inappbrowser": "^4.0.0",
"cordova-plugin-ionic-webview": "^5.0.0",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-network-information": "^2.0.2",
"cordova-plugin-purchase": "^10.0.1",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-wkwebview-ionic-xhr": "^2.1.1"
Thanks,
Cam
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]