I am making a audio player using
<audio src={audioSrc}>
tag.
When I get the audio file, it was a binary file(blob
below) so I created a blob with it.
let test = new Blob(blob, {type: 'audio/mp3'};
And then created an object url
let objUrl = URL.createObjectURL(test);
This objUrl
looks like blob:https://xxxxx
and when I pass this string to <audio src={objUrl}/>
, I cannot hear anything.
I was wondering if I have to convert this url to make it available in audio tag.
Can I get an advice for this problem please?
Just add another prop
autoplay