Reputation: 7151
I'm trying to create an audio element using new Audio()
. The data I get back from Dropbox contains an object w/ a fileBlob
property
fileBlob: Blob(5498932)
size: 5498932
type: "application/octet-stream"
__proto__: Blob
How can I get this into a format that can be passed to new Audio()
?
Upvotes: 0
Views: 279
Reputation: 2904
According to the HTMLAudioElement
-Documentation, expects a URLString
.
For that, you can use createObjectURL
new Audio(URL.createObjectURL(fileBlob))
Upvotes: 1
Reputation: 7151
const blobUrl = URL.createObjectURL(downloadPath.fileBlob);
Seems to work
Upvotes: 1