Bug 245428

Summary: Safari 16 cannot play WebM Opus from blob URL (breaks Construct 3)
Product: WebKit Reporter: Ashley Gullen <ashley>
Component: MediaAssignee: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Status: RESOLVED FIXED    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, brad, cdumez, guhenke, jean-yves.avenard, jer.noble, jgomez, mustafa.0x, rniwa, tomac, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=258713
https://bugs.webkit.org/show_bug.cgi?id=270772
https://bugs.webkit.org/show_bug.cgi?id=272502

Description Ashley Gullen 2022-09-20 08:41:31 PDT
Safari 16 on macOS appears to have support for playback of WebM Opus in the HTML <audio> element. However it does not work if passed a blob: URL.

Minimal repro: https://downloads.scirra.com/labs/bugs/webmblob/

Click "Play normally" and it will play from a normal filename. Click "Play from blob URL" and it will play from fetching the same file as a blob, calling URL.createObjectURL(blob), and playing that URL.

Observed result: clicking "Play from blob URL" does not play any audio. It also logs an error event in the console.

Expected result: it should still support playing from a blob URL. It works in Chrome, and it also works in Safari 16 if playing an MP4 (AAC) audio file. It appears only WebM Opus playback is broken when using a blob URL.

Our commercial web app Construct (www.construct.net) relies on playing audio from blob URLs in several places (especially when the user previews their project). Based on feature-detection for WebM Opus it has switched over to using built-in playback in Safari 16, but playback is now broken. Please fix it ASAP.
Comment 1 Ahmad Saleem 2022-09-20 12:28:36 PDT
I am able to reproduce this issue in Safari 16 and Safari Technical Preview 153 does not play audio from blob URL based on Comment 0 test case.

Although, I know there are fixes in Webkit ToT recently, will this be fixed? Appreciate if someone can look into it. Thanks!
Comment 2 Alexey Proskuryakov 2022-09-20 18:26:21 PDT
The behavior on this test case appears to be identical on Safari 15.6.1, so this isn't a Safari 16 regression AFAICT.
Comment 3 Radar WebKit Bug Importer 2022-09-20 20:39:38 PDT
<rdar://problem/100205028>
Comment 4 Ashley Gullen 2022-09-21 04:54:50 PDT
It's not really clear to me at the moment to what extent Safari is supposed to support WebM Opus - for example support appears to be inconsistent between macOS and iOS (see issue 238546). Perhaps there are other device specific requirements? I haven't seen any documentation covering this so it's hard to know if or where WebM Opus playback is meant to work in the first place.

We have a WebAssembly WebM Opus decoder as backup if canPlayType("audio/webm;codecs=opus") returns an empty string, so the result of calling that will affect whether our code switches over to built-in support and gets affected by this bug. Perhaps this regressed in an earlier release and I didn't notice yet.
Comment 5 mustafa.0x 2023-03-06 11:33:56 PST
Same or similar bug: fails with caf opus files, but only on iOS. It works fine on macOS. This bit me hard.

The same file plays fine via URL.
Comment 6 Ashley Gullen 2023-10-11 06:00:15 PDT
This still reproduces for me in Safari 17.
Comment 7 Ashley Gullen 2024-03-11 04:50:01 PDT
This still reproduces in Safari 17.4 which is meant to now have full support for WebM, but this issue still blocks us using WebM in Safari.
Comment 8 Jean-Yves Avenard [:jya] 2024-03-13 09:14:44 PDT
Pull request: https://github.com/WebKit/WebKit/pull/25820
Comment 9 Jean-Yves Avenard [:jya] 2024-03-14 07:02:10 PDT
Pull request: https://github.com/WebKit/WebKit/pull/25883
Comment 10 EWS 2024-03-14 21:14:55 PDT
Committed 276136@main (a7b863a49945): <https://commits.webkit.org/276136@main>

Reviewed commits have been landed. Closing PR #25820 and removing active labels.
Comment 11 Jean-Yves Avenard [:jya] 2024-04-01 19:39:40 PDT
*** Bug 270772 has been marked as a duplicate of this bug. ***
Comment 12 Jean-Yves Avenard [:jya] 2024-04-15 04:15:28 PDT
*** Bug 272502 has been marked as a duplicate of this bug. ***