Skip to content

feat: add iOS local recording controls#339

Open
zkewal wants to merge 5 commits intolivekit:mainfrom
zkewal:codex/ios-local-recording-controls-pr
Open

feat: add iOS local recording controls#339
zkewal wants to merge 5 commits intolivekit:mainfrom
zkewal:codex/ios-local-recording-controls-pr

Conversation

@zkewal
Copy link
Copy Markdown

@zkewal zkewal commented Apr 11, 2026

Summary

Add an iOS-only public API for explicitly starting and stopping local microphone recording before publish/connect. The native bridge now emits LK_AUDIO_RECORDING_STATE, giving apps a concrete recording boundary they can use for "talk now" UX instead of inferring readiness from earlier setup.

Changes

JS API surface

  • add AudioSession.startLocalRecording() and AudioSession.stopLocalRecording()
  • register LK_AUDIO_RECORDING_STATE in the JS native event registry
  • add unit coverage for method delegation and event registration

iOS bridge and recording control

  • expose startLocalRecording and stopLocalRecording through LivekitReactNativeModule
  • emit local_recording_start_requested, local_recording_started, local_recording_start_failed, and local_recording_stopped
  • add LKAudioProcessingManager wrappers that start and stop recording through WebRTC's audioDeviceModule

Cleanup

  • remove leftover NSLog output from AudioSinkRenderer

Testing & Validation

  • yarn test src/audio/AudioSession.test.ts --runInBand
  • ./node_modules/.bin/tsc --noemit -p tsconfig.build.json
  • ./node_modules/.bin/eslint src/audio/AudioSession.ts src/audio/AudioSession.test.ts src/audio/MediaRecorder.ts src/events/EventEmitter.ts --max-warnings 0
  • yarn prepare
  • xcodebuild -project ios/LivekitReactNative.xcodeproj -scheme LivekitReactNative -configuration Debug -sdk iphonesimulator build CODE_SIGNING_ALLOWED=NO

Notes for Reviewers

  • iOS-only change; this PR does not add Android behavior.
  • This builds on feat: preconnect audio buffer #256 (feat: preconnect audio buffer) by exposing a product-facing recording boundary rather than relying on earlier recorder setup state.

zkewal added 3 commits April 11, 2026 13:41
Mirror native preconnect timing into JS and cover the recorder flow with tests so early-recording behavior is easier to validate on iOS.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 11, 2026

⚠️ No Changeset found

Latest commit: 1f42ace

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@zkewal zkewal changed the title feat: add explicit iOS local recording controls feat: add iOS local recording controls Apr 11, 2026
@zkewal zkewal marked this pull request as ready for review April 11, 2026 08:57
@zkewal
Copy link
Copy Markdown
Author

zkewal commented Apr 11, 2026

@davidliu can you review this 🙌

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.

1 participant