processFile = async file => {
if (file) {
const getSize = () => file.size;
const readChunk = (chunkSize, offset) =>
new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = event => {
if (event.target.error) {
reject(event.target.error);
}
resolve(new Uint8Array(event.target.result));
};
reader.readAsArrayBuffer(file.slice(offset, offset + chunkSize));
});
return mediainfo.analyzeData(getSize, readChunk);
}
}