How to convert a Blob into a byte array? I was trying to upload a video and call to API in byte array format
After doing the below code, we getting the video in "blob:http://localhost:8080/2d118b17-34b3-4e19-8044-72e9a0c5eaff"" formate. I want to convert the blob url into byte array.
Can anyone please help me to convert bloburl into byte array?
My HTML:
<video ng-if="item.documentType == 'video'" controls width="100" height="145">
<source data-ng-src="{{item.data}}">
Your browser does not support the video tag.
</video>
My JS:
if(type == 'video'){
var item = {
name:file.files[0].name,
documentType:type,
src: file.files[0],
data: URL.createObjectURL(file.files[0]),
caseFileId: $scope.mediaItem.caseId
}
$scope.mediaItem.listDocumentDto.push(item);
}