The browser hangs when uploading large videos with angular 4

0

I am developing an application with angular 4.2 in which I have to upload videos, but when they are too large, more than 50 or 60 mb, and I load them in the browser, the browser hangs, it is just at the moment when is uploading to the browser, even before sending it to the server. I have to close the browser because it crashes, it does not respond (It's worse in Chrome than in Firefox). This is the jvascript code where I keep the url of the video and the video file:

function handleInputChange(e)
 {
    let file = e.dataTransfer ? e.dataTransfer.files[0] : e.target.files[0];
    let pattern = 'video/mp4';
    let reader = new FileReader();

    const fileSelected: File = e.target.files[0];
    this.dato_video = fileSelected;

    reader.onload = this._handleReaderLoaded.bind(this);
    reader.readAsDataURL(file);
  }

 function _handleReaderLoaded(e) {
    const reader = e.target;
    this.videoSrc = reader.result;
  } 
    
asked by Leandro Ricardo 18.09.2018 в 21:35
source

0 answers