1

I use Microsoft Azure Blob Storage to stored my video.

How do I generate the thumbnail from the video's url that I get from backend using ajax.

axios.post('my-api')
     .then(function(response) {
        var videoUrl = response.data.url;
        // How to generate thumbnail here
     })
Max
  • 4,439
  • 2
  • 18
  • 32

1 Answers1

0

@Gary, I'd recommend checking this thread which may of help to your question. using the following tutorial

They used the following code:

    function previewFile() {
  var preview = document.querySelector('img');
  var file    = document.querySelector('input[type=file]').files[0];
  var reader  = new FileReader();

  reader.onloadend = function () {
    preview.src = reader.result;
  }

  if (file) {
    reader.readAsDataURL(file);
  } else {
    preview.src = "";
  }
}
  • 1
    Thanks for your suggestion, it working in my project, but it was too slow for loading the video – Max Mar 27 '18 at 01:29