Bug 245056 - Audio element displays Error when using Blob URL as src
Summary: Audio element displays Error when using Blob URL as src
Status: RESOLVED DUPLICATE of bug 198015
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: Safari 15
Hardware: Mac (Apple Silicon) macOS 12
: P2 Normal
Assignee: Nobody
URL: https://github.com/tedsecretsource/so...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-09-11 15:34 PDT by Ted Stresen-Reuter
Modified: 2022-09-16 19:10 PDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***