[Webkit-unassigned] [Bug 198015] Cannot play audio created from blob
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon May 27 10:57:20 PDT 2019
https://bugs.webkit.org/show_bug.cgi?id=198015
--- Comment #6 from jordan.michael.last at gmail.com ---
The example I created above indeed works on all of the iOS devices I have tested. Ideally I wouldn't need to use a <source> element to specify the mime type, and indeed it is possible to create a blob and pass the mime type in. For example, if you store an mp3 file as an arraybuffer, and want to create an object URL from it:
// arrayBuffer is a variable that has already been defined, which holds mp3 audio
const blob = new Blob([arrayBuffer], { type: 'audio/mpeg' });
const objectURL = window.URL.createObjectURL(blob);
You can then set the src of an audio element to objectURL. This works on the two iOS devices that I have tested. I believe it is a solution to the StackOverflow questions.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190527/658afa87/attachment.html>
More information about the webkit-unassigned
mailing list