Skip to content

Commit 8201f25

Browse files
committed
Setup listeners early
1 parent 648c595 commit 8201f25

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,10 @@ function registerGlobals(): void {
103103
global.RTCRtpReceiver = RTCRtpReceiver;
104104
global.RTCRtpSender = RTCRtpSender;
105105
global.RTCErrorEvent = RTCErrorEvent;
106+
107+
// Ensure audioDeviceModuleEvents is initialized and event listeners are registered
108+
// This forces the constructor to run and set up native event listeners.
109+
// We use void operator to explicitly indicate we're intentionally evaluating the expression
110+
// without using its value, which prevents tree-shaking from removing this reference.
111+
void audioDeviceModuleEvents;
106112
}

0 commit comments

Comments
 (0)