Bug 245056

Summary: Audio element displays Error when using Blob URL as src
Product: WebKit Reporter: Ted Stresen-Reuter <ted>
Component: Web AudioAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ahmad.saleem792, ap, beidson, cdumez, jer.noble, rniwa, ted, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: Mac (Apple Silicon)   
OS: macOS 12   
URL: https://github.com/tedsecretsource/sound-test

Description Ted Stresen-Reuter 2022-09-11 15:34:41 PDT
Blob URLs fail as src attributes for Audio elements if the URLs are created without the second (optional) parameter.


## Expected behavior:

Given I have valid stream data created by MediaRecorder
When I create a new Blob
    AND I create a Blob URL
    AND I use the URL as the src attribute for an Audio element with the controls attribute
Then I can play (and hear) the recorded audio

## Actual behavior:

Given I have valid stream data created by MediaRecorder
When I create a new Blob
    AND I create a Blob URL
    AND I use the URL as the src attribute for an Audio element with the controls attribute
Then I can't play the recorded audio
    AND I _can_ see the word "Error" on the Audio element

I've provided [a working example in this repository](https://github.com/tedsecretsource/sound-test) and provided more information on problem and the workaround in the READMEs (one at the root level and one in the src/tests folder).

Basically, the bottom line is, at present the second parameter (options) of `new Blob(stream, {type: 'audio/mp4'})` is required. Leaving it blank should work because it is marked as optional in the MDN documentation and a functional default should be provided. At present, leaving it blank can and does result in the Actual Behavior described above.
Comment 1 Ted Stresen-Reuter 2022-09-11 15:36:43 PDT
Added repo that describes in detail the issue and workaround.
Comment 2 Radar WebKit Bug Importer 2022-09-11 19:58:08 PDT
<rdar://problem/99806427>
Comment 3 Alexey Proskuryakov 2022-09-16 19:10:14 PDT

*** This bug has been marked as a duplicate of bug 198015 ***