I am trying to enable users to upload videos to the server, but I need to provide them with a preview of the video before uploading it. However, I am facing an issue while attempting to do so.
Uploading small videos works fine, but when trying to upload larger videos for previewing, the page crashes.
This is the code snippet that I have written:
ConvertFileToAddress(event): Promise<any> {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(event);
reader.onload = (e) => {
resolve(e.target['result']);
};
});
}
Can anyone help me solve this problem?