Skip to content

chore: merge with upstream #31

Merged
santhoshvai merged 150 commits intomasterfrom
sync/upstream-cherry-picks
Apr 20, 2026
Merged

chore: merge with upstream #31
santhoshvai merged 150 commits intomasterfrom
sync/upstream-cherry-picks

Conversation

@santhoshvai
Copy link
Copy Markdown
Member

@santhoshvai santhoshvai commented Apr 16, 2026

Summary

Sync with upstream rn-webrtc/master and livekit/master. Cherry-picked relevant commits, resolved conflicts, and advanced merge-bases so future syncs only see new commits.

Features

  • RTCCertificate support — generate and use DTLS certificates for peer connections
  • getDisplayMedia constraints — pass media constraints (resolution scale, display config) to screen capture
  • minBitrate encoding parameter — set minimum bitrate on RTP encoding parameters
  • E2EE (RTCFrameCryptor) — opt-in end-to-end encryption for audio/video frames
  • DataPacketCryptor — encrypt/decrypt individual data channel packets
  • registerTrack API — register 3rd-party audio/video tracks on Android
  • defaultTrackVolume — configure default volume for remote audio tracks via WebRTCModuleOptions
  • Audio processing factory — expose AudioProcessingFactory for custom audio processing
  • Camera applyConstraints guard — prevent inadvertent camera switching through applyConstraints

Bug fixes

  • Fix ANR in getVideoTrackForStreamURL on Android (async callback pattern)
  • Fix crash when calling addIceCandidate on a closed peer connection
  • Handle null when normalizing peer connection options
  • Don't throw when applyConstraints is called on audio tracks
  • Remove track from remoteTracks on onRemoveTrack
  • Only change screen capture format when dimensions actually change
  • Runtime camera availability check on iOS simulator (replaces compile-time guard)

Refactoring

  • Vendor event-target-shim into src/vendor/ and remove npm dependency
  • Replace defineEventAttribute with getter/setter pattern across all event classes
  • Improve type safety for getSenders/getReceivers and createOffer options

Documentation

  • Add Android audio category configuration guide
  • Add PIP note (available via @stream-io/video-react-native-sdk)

Housekeeping

  • Run clang-format on all native files
  • Advance merge-base with both rn-webrtc/master and livekit/master to zero divergence

Summary by CodeRabbit

Release Notes

  • New Features

    • Added frame encryption/cryptography support for WebRTC communications
    • Added data packet encryption capabilities
    • Added certificate generation and management for peer connections
    • Added minimum bitrate control for RTP encoding
    • Enhanced Android display media with resolution scaling and configuration options
    • Added Android audio output category configuration support
  • Documentation

    • Added upstream synchronization workflow documentation
    • Updated Android installation and basic usage guides
    • Added Picture-in-Picture (PIP) reference documentation

davidliu and others added 30 commits March 28, 2024 23:11
updated upstream react-native-webrtc to 118.0.4

f1b8ff0 android, ios: remove track from remoteTracks in onRemoveTrack (#6)  ( davidliu 2024-03-28 23:11:34 +0900)
1a03f67 android: drop UVC camera support  ( Saúl Ibarra Corretgé 2024-04-04 17:11:34 +0200)
* ios: update webrtc to 114.5735.10

* make podspec fuzzy
157729c ios: update webrtc to 114.5735.10 (#7)  ( davidliu 2024-05-03 17:45:56 +0900)
495658d ci: fix build (react-native-webrtc#1562)  ( davidliu 2024-05-03 17:18:31 +0900)
822cac7 release 118.0.7  ( Saúl Ibarra Corretgé 2024-04-18 13:32:21 +0200)
882f8b1 release 118.0.6  ( Saúl Ibarra Corretgé 2024-04-11 23:03:33 +0200)
8dfc9c3 Revert "android, ios: remove track when removed from peerconnection (react-native-webrtc#1525)" (react-native-webrtc#1550)  ( Johnathon Weaver 2024-04-17 14:38:36 +0800)
c0c446a ios: fix not being able to deactivate encodings  ( Saúl Ibarra Corretgé 2024-04-11 22:31:38 +0200)
5d85486 android,ios: don't reject promise for getStats (react-native-webrtc#1541)  ( davidliu 2024-04-11 00:58:52 +0900)
f1bc9ff Update AndroidInstallation.md  ( davidliu 2024-04-09 12:01:07 +0900)
4e442f1 Update android webrtc to 114.5735.11  ( davidliu 2024-05-22 15:47:12 +0900)
651373e android: only change capture format for screen if dimen actually changed (#8)  ( davidliu 2024-05-25 20:57:36 +0900)
29210ac android: release audio device module after creating factory  ( davidliu 2024-06-21 22:05:29 +0900)
* webrtc: update WebRTC to M124

* api: allow sdpMid / sdpLineIndex to be null in RTCIceCandidate

Having both as null is still an error.

Fixes: react-native-webrtc#1518

* ios: refactor rendering in RTCVideoView

The way the renderer is implemented is as follows: there is a UIView
which holds on to a RTCMTLVideoView, which does the actual rendering in
metal.

Rather than using our own home-grown mechanism to layout the views, just
make sure the Metal view takes 100% of the space of our view, and then
use the `videoContentMode` property to set it to cover or contain,
matching the way a browser would do it.

This greatly simplifies the code because we lonnger care about the video
size, the Metal renderer makes the adjustments autmagically.

In addition, the mirror and object-fit properties are only applied once,
when they change, not on every layout change, which is unnecessary.

* ios: add all available camera device types

* preserve order

* release 124.0.1

20cf1d5 preserve order  ( Burak KIYAK 2024-05-03 13:41:59 +0200)
64e8298 ios: add all available camera device types  ( Burak KIYAK 2024-04-30 12:30:38 +0200)
f36b6b8 ios: refactor rendering in RTCVideoView  ( Saúl Ibarra Corretgé 2024-06-11 09:35:36 +0200)

* build(deps-dev): bump braces from 3.0.2 to 3.0.3 (react-native-webrtc#1578)

Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* mark for beta release

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Saúl Ibarra Corretgé <saghul@jitsi.org>
Co-authored-by: omerts <omerts3@gmail.com>
Co-authored-by: Saúl Ibarra Corretgé <s@saghul.net>
Co-authored-by: Burak KIYAK <brkkyk@gmail.com>
Co-authored-by: Burak KIYAK <bkiyak@turnitin.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2d153e1 Merge upstream and update webrtc to M125 (#9)  ( davidliu 2024-06-24 11:20:10 +0900)
49af0ad ios: Add audioProcessingModule to WebRTCModuleOptions (#13)  ( davidliu 2024-07-26 14:22:57 +0900)
774f39e android: declare a dependency on androidx.core 1.7.0  ( davidliu 2024-06-25 19:37:49 +0900)
6986a6e Update README.md  ( davidliu 2024-06-24 14:30:33 +0900)
e0740f0 Update README.md to avoid confusion with the original  ( davidliu 2024-06-24 14:30:17 +0900)
ffd5936 android,ios: update webrtc to 125.0.4  ( davidliu 2024-08-05 00:25:40 +0900)
09f609b release 124.0.3  ( Saúl Ibarra Corretgé 2024-07-08 10:43:08 +0200)
3e11c99 misc: ignore Android build files when releasing to npm  ( Saúl Ibarra Corretgé 2024-07-08 10:42:23 +0200)
a45efdc release 124.0.2  ( Saúl Ibarra Corretgé 2024-07-08 10:39:16 +0200)
160ece9 ios: fix compatibility with RN >= 0.73  ( Saúl Ibarra Corretgé 2024-06-27 23:04:49 +0200)
5fdb6ad android: declare dependency on androidx.core 1.7.0 (react-native-webrtc#1586)  ( davidliu 2024-06-26 00:30:02 +0900)
0a36e9d android: release audio manager module after creating factory  ( davidliu 2024-06-21 22:04:45 +0900)
54b5607 build(deps-dev): bump braces from 3.0.2 to 3.0.3 (react-native-webrtc#1578)  ( dependabot[bot] 2024-06-13 17:59:14 +0800)
232fc06 release 124.0.1  ( Saúl Ibarra Corretgé 2024-06-13 10:45:44 +0200)
20cf1d5 preserve order  ( Burak KIYAK 2024-05-03 13:41:59 +0200)
64e8298 ios: add all available camera device types  ( Burak KIYAK 2024-04-30 12:30:38 +0200)
f36b6b8 ios: refactor rendering in RTCVideoView  ( Saúl Ibarra Corretgé 2024-06-11 09:35:36 +0200)
bbd903c api: allow sdpMid / sdpLineIndex to be null in RTCIceCandidate  ( omerts 2024-06-04 14:42:40 +0300)
ff6110e webrtc: update WebRTC to M124  ( Saúl Ibarra Corretgé 2024-06-03 14:33:18 +0200)
* ios: add support for external cameras on iPad

* ci: remove flipper from gumtestapp (react-native-webrtc#1608)

These were causing build errors recently, and were generally unneeded anyways.

* pc: align createDataChannel with standard

- Throw TypeError if no argument passed
- Stringify the label

Fixes: react-native-webrtc#1605

* android: report actual size in camera MediaStreamTrack settings (react-native-webrtc#1598)

* ios: fix exception in iOS 17+ w/ Xcode 15.4

* android: remove no longer used replace rule from manifest (react-native-webrtc#1609)

* sender: fix serializing RTCRtpSendParameters

It's possible for user code to replace encodings entirely. Thus, the
resulting array will not have RTCRtpEncodingParameters object instances,
but plain objects.

Handle it by deep-cloning the objects with JSON.parse(JSON.stringify(x))
since that will take care of appropriately serializing them, no matter
the type.

* misc: make serialization more resilient

Don't directly call toJSON, but rather rely on JSON serialization to do
it when cloning.

* release 124.0.4

89557ca misc: make serialization more resilient  ( Saúl Ibarra Corretgé 2024-08-14 11:53:32 +0200)
6cfedd7 sender: fix serializing RTCRtpSendParameters  ( Saúl Ibarra Corretgé 2024-08-14 11:11:08 +0200)
ac7f578 android: remove no longer used replace rule from manifest (react-native-webrtc#1609)  ( Saúl Ibarra Corretgé 2024-08-07 17:17:03 +0200)
f6667c8 ios: fix exception in iOS 17+ w/ Xcode 15.4  ( mtdxc 2024-08-07 17:22:10 +0800)
4c34ae1 android: report actual size in camera MediaStreamTrack settings (react-native-webrtc#1598)  ( davidliu 2024-08-07 17:56:57 +0900)
fb02a5b pc: align createDataChannel with standard  ( Saúl Ibarra Corretgé 2024-08-06 15:28:24 +0200)
c0ddefd ci: remove flipper from gumtestapp (react-native-webrtc#1608)  ( davidliu 2024-08-07 16:00:01 +0900)
a1bb18a ios: add support for external cameras on iPad  ( mtdxc 2024-07-10 20:25:23 +0800)

* ios: Add RTCAudioSession helper methods needed for CallKit (react-native-webrtc#1614)

* Fix package name references

---------

Co-authored-by: mtdxc <mtdxc@126.com>
Co-authored-by: Saúl Ibarra Corretgé <s@saghul.net>
Co-authored-by: Saúl Ibarra Corretgé <saghul@jitsi.org>
c10087e Merge upstream 124.0.4 into master (#16)  ( davidliu 2024-08-19 14:45:18 +0900)
1121257 ci: fix ios compile (#14)  ( davidliu 2024-08-05 14:30:17 +0900)
santhoshvai and others added 2 commits April 16, 2026 10:37
PIP support is available via @stream-io/video-react-native-sdk,
not this package.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Record merge to advance the merge-base so future merges from
rn-webrtc/master only see new commits. All useful upstream changes
were already cherry-picked in prior commits. Skipped commits
(PIP, release bumps, duplicate features) resolved by keeping
our versions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 16, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 80d9da4b-15cf-4c80-b7d0-f5644564b7ec

📥 Commits

Reviewing files that changed from the base of the PR and between 77af439 and 14c182c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (81)
  • .claude/skills/upstream-sync.md
  • .eslintignore
  • Documentation/AndroidInstallation.md
  • Documentation/BasicUsage.md
  • Documentation/CallGuide.md
  • README.md
  • android/src/main/java/com/oney/WebRTCModule/AbstractVideoCaptureController.java
  • android/src/main/java/com/oney/WebRTCModule/CameraCaptureController.java
  • android/src/main/java/com/oney/WebRTCModule/DataPacketCryptorManager.java
  • android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java
  • android/src/main/java/com/oney/WebRTCModule/MediaProjectionNotification.java
  • android/src/main/java/com/oney/WebRTCModule/MediaProjectionService.java
  • android/src/main/java/com/oney/WebRTCModule/PeerConnectionObserver.java
  • android/src/main/java/com/oney/WebRTCModule/RTCCryptoManager.java
  • android/src/main/java/com/oney/WebRTCModule/ScreenCaptureController.java
  • android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java
  • android/src/main/java/com/oney/WebRTCModule/SpeechActivityDetector.java
  • android/src/main/java/com/oney/WebRTCModule/VideoTrackAdapter.java
  • android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java
  • android/src/main/java/com/oney/WebRTCModule/WebRTCModuleOptions.java
  • android/src/main/java/com/oney/WebRTCModule/WebRTCView.java
  • android/src/main/java/com/oney/WebRTCModule/audio/AudioProcessingController.java
  • android/src/main/java/com/oney/WebRTCModule/webrtcutils/WrappedVideoDecoderFactory.java
  • android/src/main/java/org/webrtc/Camera1Helper.java
  • android/src/main/java/org/webrtc/Camera2Helper.java
  • examples/GumTestApp/ios/GumTestApp.xcodeproj/project.pbxproj
  • ios/RCTWebRTC/AudioDeviceModuleObserver.m
  • ios/RCTWebRTC/CaptureController.h
  • ios/RCTWebRTC/CaptureController.m
  • ios/RCTWebRTC/InAppScreenCaptureController.m
  • ios/RCTWebRTC/InAppScreenCapturer.m
  • ios/RCTWebRTC/RCTConvert+WebRTC.m
  • ios/RCTWebRTC/RTCVideoViewManager.m
  • ios/RCTWebRTC/ScreenCaptureController.m
  • ios/RCTWebRTC/SerializeUtils.m
  • ios/RCTWebRTC/VideoCaptureController.h
  • ios/RCTWebRTC/VideoCaptureController.m
  • ios/RCTWebRTC/WebRTCModule+RTCAudioDeviceModule.m
  • ios/RCTWebRTC/WebRTCModule+RTCFrameCryptor.m
  • ios/RCTWebRTC/WebRTCModule+RTCMediaStream.h
  • ios/RCTWebRTC/WebRTCModule+RTCMediaStream.m
  • ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.h
  • ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m
  • ios/RCTWebRTC/WebRTCModule+Transceivers.m
  • ios/RCTWebRTC/WebRTCModule+VideoTrackAdapter.m
  • ios/RCTWebRTC/WebRTCModule.h
  • ios/RCTWebRTC/WebRTCModule.m
  • ios/RCTWebRTC/WebRTCModuleOptions.h
  • ios/RCTWebRTC/WebRTCModuleOptions.m
  • ios/RCTWebRTC/videoEffects/ProcessorProvider.h
  • ios/RCTWebRTC/videoEffects/ProcessorProvider.m
  • ios/RCTWebRTC/videoEffects/VideoEffectProcessor.h
  • ios/RCTWebRTC/videoEffects/VideoEffectProcessor.m
  • ios/RCTWebRTC/videoEffects/VideoFrameProcessor.h
  • package.json
  • src/EventEmitter.ts
  • src/MediaDevices.ts
  • src/MediaStream.ts
  • src/MediaStreamTrack.ts
  • src/MediaStreamTrackEvent.ts
  • src/MessageEvent.ts
  • src/RTCCertificate.ts
  • src/RTCDataChannel.ts
  • src/RTCDataChannelEvent.ts
  • src/RTCDataPacketCryptor.ts
  • src/RTCDataPacketCryptorFactory.ts
  • src/RTCErrorEvent.ts
  • src/RTCFrameCryptor.ts
  • src/RTCFrameCryptorFactory.ts
  • src/RTCIceCandidateEvent.ts
  • src/RTCKeyProvider.ts
  • src/RTCPeerConnection.ts
  • src/RTCRtpEncodingParameters.ts
  • src/RTCTrackEvent.ts
  • src/RTCUtil.ts
  • src/getDisplayMedia.ts
  • src/index.ts
  • src/vendor/event-target-shim/LICENSE
  • src/vendor/event-target-shim/index.d.ts
  • src/vendor/event-target-shim/index.js
  • tools/build-webrtc.py

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Walkthrough

This pull request introduces comprehensive frame cryptography support (frame cryptors, key providers, data packet cryptors), certificate generation and lifecycle management, and enhanced display media constraints for Android. It refactors event handler properties across TypeScript classes to use explicit getters/setters, vendors the event-target-shim module, and updates documentation for new audio device options and constraints handling.

Changes

Cohort / File(s) Summary
Documentation Updates
Documentation/AndroidInstallation.md, Documentation/BasicUsage.md, Documentation/CallGuide.md, README.md, .claude/skills/upstream-sync.md
Added sections for Android audio output configuration, display media constraints, PIP disclaimer, and upstream sync workflow; updated sessionConstraints examples to use camelCase keys instead of mandatory-wrapped capitalized keys.
Android Frame Cryptography
android/src/main/java/com/oney/WebRTCModule/DataPacketCryptorManager.java, android/src/main/java/com/oney/WebRTCModule/RTCCryptoManager.java
New classes for managing data packet cryptography with encrypt/decrypt/dispose operations and frame cryptor lifecycle management with state event dispatch.
Android Display Media & Constraints
android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java, android/src/main/java/com/oney/WebRTCModule/ScreenCaptureController.java
Added constraints parameter support for getDisplayMedia; added createConfigForDefaultDisplay and resolutionScale handling; scaled capture dimensions by resolution factor.
Android Camera & RTC Configuration
android/src/main/java/com/oney/WebRTCModule/CameraCaptureController.java, android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java, android/src/main/java/com/oney/WebRTCModule/WebRTCModuleOptions.java
Introduced immutable constraint fields for initial camera selection; added certificate storage/retrieval and generateCertificate support; added audioProcessingFactoryFactory and defaultTrackVolume options.
Android Audio & RTP Updates
android/src/main/java/com/oney/WebRTCModule/PeerConnectionObserver.java, android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java
Added audio track volume configuration from module options; added minBitrate support to RTP encoding parameters.
Android Media & View Handling
android/src/main/java/com/oney/WebRTCModule/MediaProjectionNotification.java, android/src/main/java/com/oney/WebRTCModule/MediaProjectionService.java, android/src/main/java/com/oney/WebRTCModule/WebRTCView.java
Reformatted media projection code and simplified notification building; converted synchronous video track lookup to async callback-based pattern.
Android Formatting & Minor Updates
android/src/main/java/com/oney/WebRTCModule/AbstractVideoCaptureController.java, android/src/main/java/com/oney/WebRTCModule/SpeechActivityDetector.java, android/src/main/java/com/oney/WebRTCModule/VideoTrackAdapter.java, android/src/main/java/com/oney/WebRTCModule/audio/AudioProcessingController.java, android/src/main/java/com/oney/WebRTCModule/webrtcutils/WrappedVideoDecoderFactory.java, android/src/main/java/org/webrtc/Camera1Helper.java, android/src/main/java/org/webrtc/Camera2Helper.java
Code formatting, comment reflowing, and whitespace normalization with no functional changes.
iOS Frame Cryptography & Crypto Module
ios/RCTWebRTC/WebRTCModule+RTCFrameCryptor.m, ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m
New module category implementing frame cryptor factory, key provider, and data packet cryptor APIs with delegate-based state change events; added certificate generation with fingerprint computation and lookup methods for senders/receivers/transceivers.
iOS Display Media & Constraints
ios/RCTWebRTC/WebRTCModule+RTCMediaStream.m
Updated getDisplayMedia to accept constraints parameter; added runtime device availability check for simulator capture initialization; exported track lookup method.
iOS Video Capture & Track Handling
ios/RCTWebRTC/VideoCaptureController.m, ios/RCTWebRTC/VideoCaptureController.h
Refactored device/constraint logic: moved device selection into determineDevice: method called during initialization; narrowed applyConstraints:error: to handle only dimension/fps changes.
iOS Audio & RTP Updates
ios/RCTWebRTC/WebRTCModule+Transceivers.m, ios/RCTWebRTC/SerializeUtils.m, ios/RCTWebRTC/WebRTCModuleOptions.h, ios/RCTWebRTC/WebRTCModuleOptions.m
Added minBitrate to RTP encoding parameters; added defaultTrackVolume property to module options; applied default volume to remote audio tracks.
iOS Screen & Media Capture
ios/RCTWebRTC/ScreenCaptureController.m, ios/RCTWebRTC/InAppScreenCaptureController.m, ios/RCTWebRTC/InAppScreenCapturer.m
Condensed settings dictionary formatting; reformatted block declarations and guard clauses without altering capture lifecycle logic.
iOS Configuration & Event Handling
ios/RCTWebRTC/RCTConvert+WebRTC.m, ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.h
Added certificate fetching logic to RTCConfiguration parsing; added getter methods for senders, receivers, and transceivers by ID.
iOS Property & Header Updates
ios/RCTWebRTC/CaptureController.h, ios/RCTWebRTC/CaptureController.m, ios/RCTWebRTC/RTCVideoViewManager.m, ios/RCTWebRTC/VideoEffectProcessor.h, ios/RCTWebRTC/VideoCaptureController.h, ios/RCTWebRTC/WebRTCModule+RTCMediaStream.h
Updated property/method declaration spacing from spaced to unspaced Objective-C syntax; adjusted indentation in layout methods; no functional logic changes.
iOS Formatting & Minor Updates
ios/RCTWebRTC/AudioDeviceModuleObserver.m, ios/RCTWebRTC/WebRTCModule+RTCAudioDeviceModule.m, ios/RCTWebRTC/WebRTCModule.h, ios/RCTWebRTC/WebRTCModule.m, ios/RCTWebRTC/videoEffects/ProcessorProvider.h, ios/RCTWebRTC/videoEffects/ProcessorProvider.m, ios/RCTWebRTC/videoEffects/VideoEffectProcessor.m, ios/RCTWebRTC/videoEffects/VideoFrameProcessor.h, ios/RCTWebRTC/RTCDataChannelEvent.ts, ios/RCTWebRTC/RTCErrorEvent.ts, ios/RCTWebRTC/RTCIceCandidateEvent.ts, ios/RCTWebRTC/RTCTrackEvent.ts
Code formatting, whitespace normalization, line wrapping adjustments, and removed commented-out code with no functional changes.
TypeScript Certificate Support
src/RTCCertificate.ts, src/RTCUtil.ts, src/RTCPeerConnection.ts
New RTCCertificate class and RTCCertificateFingerprint type; added generateCertificate static method to RTCPeerConnection; updated configuration to support certificates array with certificate ID mapping.
TypeScript Frame Cryptography
src/RTCFrameCryptor.ts, src/RTCFrameCryptorFactory.ts, src/RTCKeyProvider.ts, src/RTCDataPacketCryptor.ts, src/RTCDataPacketCryptorFactory.ts
New frame cryptor, key provider, and data packet cryptor classes with event emission, async key management, and encryption/decryption operations; new factory classes for creating cryptor instances with native module bridging.
TypeScript Event Handler Refactoring
src/MediaDevices.ts, src/MediaStream.ts, src/MediaStreamTrack.ts, src/RTCDataChannel.ts
Replaced defineEventAttribute prototype-based event setup with explicit instance-level getter/setter properties using getEventAttributeValue/setEventAttributeValue; updated import paths to vendored event-target-shim; adjusted applyConstraints to log info for non-video tracks instead of throwing.
TypeScript Display Media & Constraints
src/getDisplayMedia.ts, src/MediaDevices.ts
Added constraints parameter support to getDisplayMedia; introduced DisplayMediaConstraints interface with Android-specific options; forwarded constraints to native module.
TypeScript RTP & Encoding
src/RTCRtpEncodingParameters.ts
Added optional minBitrate field and getter/setter to RTCRtpEncodingParameters with validation and JSON serialization support.
TypeScript Event Types & Exports
src/MediaStreamTrackEvent.ts, src/MessageEvent.ts, src/index.ts, src/EventEmitter.ts
Updated Event import paths to vendored module; re-exported new cryptography, certificate, and encoding classes and types; added frameCryptionStateChanged to native event allowlist.
Event Target Shim Vendor
src/vendor/event-target-shim/index.d.ts, src/vendor/event-target-shim/index.js, src/vendor/event-target-shim/LICENSE
Added vendored event-target-shim implementation with TypeScript definitions, full event/event-target implementation, listener management, and event attribute handler support; includes MIT license.
Configuration & Build
package.json, .eslintignore, examples/GumTestApp/ios/GumTestApp.xcodeproj/project.pbxproj
Bumped version to 137.1.4-alpha.10; removed event-target-shim dependency; added src/vendor to eslint ignore; updated Xcode build settings for OTHER_LDFLAGS.
Build Tools Removed
tools/build-webrtc.py
Deleted WebRTC build automation script that handled iOS/Android framework building and packaging.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

The changes involve significant heterogeneous modifications across Android (Java), iOS (Objective-C), and TypeScript layers. Key complexity factors include: (1) new frame cryptography APIs with multi-layer native-JS integration, (2) certificate lifecycle management across platforms, (3) event handler refactoring affecting multiple TypeScript classes, (4) vendored event-target-shim with 1200+ lines of implementation, (5) constraint handling updates for display media, and (6) logic changes in camera selection and audio track configuration. While patterns repeat across files (event handler refactoring, formatting), they require individual reasoning per file due to context-specific implementations.

🐰 With paws a-twitching and whiskers held high,
We crypts did unlock and certificates fly!
Frame ciphers secured, events now so neat,
A vendored shim bundled—the refactor's complete!
🔐✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/upstream-cherry-picks

davidliu and others added 23 commits April 16, 2026 12:02
* pc: don't throw when applyConstraints on audio tracks

* lint
…ivekit#33)

* android,ios: add defaultTrackVolume control to WebRTCModuleOptions

* fix android build
* Add AudioProcessingFactory to WebRTCModuleOptions

* Expose media stream tracks for ios

* Swift compatibility

* Fix boost checksum error
Migrate from defineEventAttribute to getter/setter pattern
matching the rest of the codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* android data cryptor impl

* ios: data packet cryptor

* fixes

* formattting

* lint fix
Record merge to advance the merge-base so future merges from
livekit/master only see new commits. All useful upstream changes
were already cherry-picked in prior commits.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix duplicate audioProcessingFactory variable (merge both providers)
- Remove AES_CBC reference (not in StreamWebRTC M137, only AES_GCM)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
LiveKit's code used FrameCryptionState* naming from an older WebRTC
version. StreamWebRTC M137 uses RTCFrameCryptorState* prefix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reverts the remoteTracks.remove() from f1b8ff0. The didRemoveReceiver
delegate can fire during renegotiation while the track is still active,
causing remote tracks to become invisible.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Event type is 'framecryptorstatechanged' (no 'on' prefix).
The getter/setter 'onframecryptorstatechanged' follows DOM convention
where 'on' + event name = property name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@santhoshvai santhoshvai marked this pull request as ready for review April 20, 2026 09:02
@santhoshvai santhoshvai merged commit 3137750 into master Apr 20, 2026
3 of 4 checks passed
@santhoshvai santhoshvai deleted the sync/upstream-cherry-picks branch April 20, 2026 09:02
santhoshvai added a commit that referenced this pull request Apr 20, 2026
Master merged sync/upstream-cherry-picks via PR #31 while this branch
had already merged the same branch directly (c4d93d3), producing a
criss-cross topology. Rebase would have replayed 147 commits; merge
handles the same-source reconciliation cleanly.

Conflicts resolved:
- Android PeerConnectionObserver + iOS WebRTCModule+RTCPeerConnection:
  audio-track add branch — kept both the AudioTrackAdapter attach and
  the upstream defaultTrackVolume setter (orthogonal concerns).
- package.json: kept alpha.11 (higher).
- package-lock.json: regenerated from package.json.

Fixed silent 3-way merge artefact: removed duplicated generateCertificate
static method that git auto-merge emitted twice in RTCPeerConnection.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.