Convert blob to base64

后端 未结 9 2012
无人共我
无人共我 2020-11-22 13:12

This is a snippet for the code that I want to do Blob to Base64 string:

This commented part works and that when the URL generated by this i

9条回答
  •  长情又很酷
    2020-11-22 13:37

    var audioURL = window.URL.createObjectURL(blob);
    audio.src = audioURL;
    
    var reader = new window.FileReader();
    reader.readAsDataURL(blob);
    reader.onloadend = function () {
         base64data = reader.result;
         console.log(base64data);
    }
    

提交回复
热议问题