I'm trying to zip a mp4 video from remote URL, is this possible? any advice?
thanks in advance!
In a browser or with nodejs ? Either way, you should see the relevant part of the documentation.
MP4 files are already compressed so you can skip the compression (compression = STORE, the default) here.
close now?
Hi guys,
I have the same issue. @carloscarcamo I would like to know if you have found a solution ?
Thanks in advance.
Best regards.
Without response from @carloscarcamo, I'm closing this one. @waylander47: could you create a new issue with more details (what you're trying to do, where you're stuck at, etc) ?
Ok here is the solution to do it on locals mp4 videos :
```javascript
var fileURL = URL.createObjectURL(localFile)
JSZipUtils.getBinaryContent(fileURL, function (err, data) {
if(err) {
console.log(err); // or handle the error
}
var zip = new JSZip();
zip.file("video.mp4", data, {binary:true});
zip.generateAsync({type:"blob"}).then(function (blob) {
saveAs(blob, "archive.zip");
}, function (err) {
console.log(err);
});
});
Most helpful comment
Ok here is the solution to do it on locals mp4 videos :
```javascript
var fileURL = URL.createObjectURL(localFile)
JSZipUtils.getBinaryContent(fileURL, function (err, data) {
if(err) {
console.log(err); // or handle the error
}
var zip = new JSZip();
zip.file("video.mp4", data, {binary:true});
zip.generateAsync({type:"blob"}).then(function (blob) {
saveAs(blob, "archive.zip");
}, function (err) {
console.log(err);
});
});