Bug 245056
| Summary: | Audio element displays Error when using Blob URL as src | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ted Stresen-Reuter <ted> | 
| Component: | Web Audio | Assignee: | 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 | ||
          Ted Stresen-Reuter
          
          
          
          
        
        
      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.
    | Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. | 
          Ted Stresen-Reuter
          
          
          
          
        
        
      Added repo that describes in detail the issue and workaround.
    
          Radar WebKit Bug Importer
          
          
          
          
        
        
      <rdar://problem/99806427>
    
          Alexey Proskuryakov
          
          
          
          
        
        
      
*** This bug has been marked as a duplicate of bug 198015 ***