Skip to content

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Sep 29, 2025

Followup to #25381

@sbc100 sbc100 requested review from juj and kripken September 29, 2025 19:44
Copy link
Collaborator

@juj juj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 👍

@sbc100 sbc100 force-pushed the globalThis branch 3 times, most recently from 557511c to ee67765 Compare September 29, 2025 21:34
case 0x1005 /* ALC_DEVICE_SPECIFIER */:
if (typeof AudioContext != 'undefined' ||
typeof webkitAudioContext != 'undefined') {
if (globalThis.AudioContext || globalThis.webkitAudioContext) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can probably remove webkitAudioContext?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do that as a followup.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it looks like the unprefixed version is needed until Safari 14.5

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird...wasn't Safari/Webkit the first to implement WebAudio back in the day?

But I see MDN says

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safari 14.1 (Release date: ⁨2021-04-26⁩)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Safari iOS its 14.5

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safari < 14.5 still needs the webkit prefix. I authored this on another call site recently: #25356

Weird...wasn't Safari/Webkit the first to implement WebAudio back in the day?

I think what happened is that they went ahead to implement a very first version of the draft/spec, and then the spec got matured, and they took a long time to come back and unprefix their implementation. The webkitAudioContext() and the .noteOn() quirks stayed for a long time.

@sbc100 sbc100 enabled auto-merge (squash) September 29, 2025 23:38
@sbc100 sbc100 merged commit 834eb88 into emscripten-core:main Sep 30, 2025
33 checks passed
@sbc100 sbc100 deleted the globalThis branch September 30, 2025 00:00
sbc100 added a commit to sbc100/emscripten that referenced this pull request Sep 30, 2025
Also, make node detection consistent between file_packager output and
emscripten output.

Followup to emscripten-core#25417
sbc100 added a commit that referenced this pull request Sep 30, 2025
Also, make node detection consistent between file_packager output and
emscripten output.

Followup to #25417
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants