I am opening a video file using input type file. Following is the function that is being called and file is being sent here.
function fetchVideo(file) {
if(file) {
var reader = new FileReader();
reader.onload = function(e) {
layoutVM.video = e.target.result;
}
reader.readAsDataURL(file);
}
}
The html for this is
<video loop muted autoplay>
<source ng-src="{{layoutVM.video}}" type="video/mp4">
</video>
After FileReader works, e.target.result gets a long string starting from "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACA .................................. "
The video is not being loaded in source, any idea?