Closed prometeomcclellan closed 6 months ago
`$("#fileInputV").on("change", evt => { evt.preventDefault(); evt.stopPropagation(); evt.stopImmediatePropagation(); const fileInputVs = (document.getElementById("fileInputV") as HTMLInputElement).files; console.dir(fileInputVs); this.isVideo = true;
setTimeout(() => {
if (fileInputVs.length > 0) {
this.videosSeleccionados = fileInputVs.length;
$("#imagenesConteo").fadeIn('xslow');
$("#buttonSubmitVideo").fadeIn('xslow');
for (let index = 0; index < fileInputVs.length; index++) {
this.fechaFirma = new Date().toISOString();
const file = fileInputVs[index];
var path = (window.URL || window.webkitURL).createObjectURL(file);
console.log('path', path);
VideoEditor.edit({
path: path.substring(12),
transcode: {
width: 720,
height: 480,
keepAspectRatio: true,
},
trim: {
startsAt: 3 * 1000, // from 00:03
endsAt: 10 * 1000, // to 00:10
},
}).then(
(mediaFileResult: MediaFileResult) => {
// progressListener.remove();
alert(parseInt(localStorage.getItem('idAtencion')))
this.videos.push(mediaFileResult.file);
this.videoArray = {
IdAtencion: parseInt(localStorage.getItem('idAtencion')),
VideoData: mediaFileResult.file
}
console.log('El comprimido ');
console.dir(this.videoArray)
console.log('mediaPath', mediaFileResult.file.path);
},
(error) => {
console.error('error', error);
}
);
if (index == (fileInputVs.length-1)) {
this.isLoading = false
}
}
}else{
}
}, this.randomIntFromInterval(1, 5));
});
}`
Hi @prometeomcclellan
Could you attach the logcat (android) output?
Also add the line console.log('mediaFileResult', mediaFileResult)
just before the alert(...)
and show the output as well.
Sure thing. And now I realize it's a matter of it seems not to work on Web but on devices only. Am I right? Sorry to bother. Let me give a try and test in a mobile device.
And this is the Android Studio Log about this issue.
The path
field must be a local path. It can optionally starts with file://
, but in the previous example you use a blob:http
and it is not valid.
Ok. I tried that on Web the path.substring(11); Let me give it a hit on mobile and I'll let you know. Thanks for your time.
Hi Do you have any suggestion for converting to local path Currently I can generate the following URLs
http://localhost/_capacitor_content_/com.android.providers.media.documents/document/video%3A1000123897
Or
content://com.android.providers.media.documents/document/video%3A1000123897
Hi!
Results from plugin capacitor-plugin-file-picker
(https://github.com/dragermrb/capacitor-plugin-file-picker) are valid as path for capacitor-plugin-video-editor
Hi @dragermrb ! Do you plan to release a new version of the file picker plugin with Capacitor 6 support? Thanks 🫶
Hello. I'm trying to compress videos to low their size and be able to upload them to my server. I have installed and followed the documentation of yours. The thing is that when my code gets to the point of MediaFileResult it just goes out of the function and I just can not get the result.
So basically here is my code.