using FileReader readAsDataURL to read locally uploaded video files is often not previewed as shown in figure
code is as follows
var reader = new FileReader ();
reader.onload = (evt) => {
if (videoType.indexOf(fileType.toLocaleLowerCase()) !== -1) {
$(".waitUpload .nullVideo").remove();
$(".waitUpload").html(
"<div data-filename="" + fileName +
"">\
<div>\
<div class="videoCtn"><video src="" +
evt.target.result +
"" controls></video></div>\
</div>\
<div class="videoInfo">\
<span class="videoName" title="" +
fileName + "">" +
fileName + "</span>\
<span class="videoSize">" +
size +
"M</span>\
</div>\
<div class="btnCtn">\
<span class="btn" data-toggle="modal" data-target=".modal"></span>\
</div>\
</div>"
);
file = _this.files[0];
localAddress = evt.target.result;
} else {
alert("");
}
$(this).val("");
};
reader.readAsDataURL(this.files[0]);