fix(ios audio): re-assert earpiece after WebKit re-forces speaker (debounced)

Telemetry proof: overrideOutputAudioPort(.none) routes to Receiver once, then every
later toggle latches to built-in Speaker despite opts=36 (no .defaultToSpeaker) —
WebKit's WebRTC engine re-forces the loudspeaker after our override. The prior build
ignored .override-reason route changes and never corrected it.

Now: react to ALL route changes, debounced 0.25s, and re-assert the chosen port only
on a genuine mismatch (self-terminating, capped at 6/toggle to avoid thrash). setSpeaker
returns a reason->port route-change trail so the log shows whether WebKit is one-shot
or persistent. native marker 1.0.3-reassert.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-21 22:20:29 +05:30
parent 36d51ba40d
commit ce49e8e30d
2 changed files with 55 additions and 40 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "audio-route",
"version": "1.0.2",
"version": "1.0.3",
"description": "iOS earpiece/speaker audio route toggle for Biz Connect",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",