Repository navigation
Conversation
These were causing build errors recently, and were generally unneeded anyways.
- Throw TypeError if no argument passed - Stringify the label Fixes: react-native-webrtc#1605
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.
Don't directly call toJSON, but rather rely on JSON serialization to do it when cloning.
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)
…mplement applyConstraints (react-native-webrtc#1615)
* android: add libwebrtc consumer proguard rules * remove proguard rule instructions
359caea android: document how to set audio category to media ( Saba 2025-01-04 10:01:46 +0100) 036e374 android: add libwebrtc consumer proguard rules ( davidliu 2024-12-20 23:23:52 +0900) 996c128 ios: picture in picture implementation ( davidliu 2024-12-13 21:59:33 +0900) b62727a ios: add background camera access option ( davidliu 2024-12-02 04:44:14 -0800) 4f337cd doc: remove duplicate / confusing information about screen-sharing (react-native-webrtc#1645) ( Saúl Ibarra Corretgé 2024-11-04 13:07:11 +0100) 8bd5e0a android: don't use minSdkVersion set by app (react-native-webrtc#1625) ( davidliu 2024-09-17 12:47:59 +0900) f3f3301 ios,android: add device/groupId to MediaStreamTrack.getSettings and implement applyConstraints (react-native-webrtc#1615) ( davidliu 2024-08-26 17:50:58 +0900) 609c0b5 ios: Add RTCAudioSession helper methods needed for CallKit (react-native-webrtc#1614) ( davidliu 2024-08-16 13:51:28 +0900)
Use nvm for choosing the Node version.
It's now maintained here: https://github.com/jitsi/webrtc/blob/master/tools/build-webrtc.py
FIX resolve react-android dependency for debugging builds
…e-webrtc#1681) * Multiple video frame processors + implementation for ios * fix(ios): add missing capturer property * Early return, null frame check and leak fix * Leak fix. * Formatting
* Enables video dimension change event Adds support for an event that is triggered when the dimensions of the video stream change. This allows the application to react to changes in video size, for example, to adjust the UI accordingly. * Fix TS definition and update docs * PR feedback
in particular when the first instance is wrongly setting the sender to the receiver
…eact-native-webrtc#1821) When close() is called, libwebrtc emits the observer state changes in the order iceConnectionState, connectionState, then signalingState (all "closed"). react-native-webrtc was tearing down its listeners on connectionState === "closed", which dropped the subsequent signalingState "closed" event, leaving signalingState stuck at its previous value. Move the teardown to the signalingState === "closed" handler so every final state change is applied before the listeners are removed. See PeerConnection::Close(): https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/pc/peer_connection.cc;l=1818;drc=4e0c079a2b24c7ec577949494e94ba6f5bf264e4
…t-native-webrtc#1817) Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.12.8 to 7.29.6. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.29.6/packages/babel-core) --- updated-dependencies: - dependency-name: "@babel/core" dependency-version: 7.29.6 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
78904d2 android: fix race condition in getDisplayMedia ( Saúl Ibarra Corretgé 2026-03-20 10:08:16 +0100) 0a89cc0 ci(ios): pin runner to macos-15 (Xcode 16.4) ( Calin-Teodor 2026-07-08 11:51:04 +0300) 5892a0f ios(RCTWebRTC): enable Center Stage for devices that support it ( Calin-Teodor 2026-07-08 11:27:56 +0300) 3537d38 build(deps-dev): bump @babel/core in /examples/GumTestApp_macOS (react-native-webrtc#1817) ( dependabot[bot] 2026-07-05 13:56:36 +0800) e8face3 dispose the peer connection after signalingState changes to "closed" (react-native-webrtc#1821) ( Philipp Hancke 2026-07-05 07:53:11 +0200) 0c63622 registerGlobals: don't set RTCRtpSender/RTCRtpReceiver twice ( Philipp Hancke 2026-07-04 11:25:23 +0200) c4ea2d3 build(deps-dev): bump js-yaml from 4.1.1 to 4.2.0 (react-native-webrtc#1818) ( dependabot[bot] 2026-06-24 02:46:34 +0800) e5d8781 ios: fix trigger broadcast picker on new arch ( Calinteodor 2026-06-04 13:03:43 +0300) 3655418 fix: preserve facing mode in applyConstraints ( naveenkirugulige 2026-05-11 13:01:44 +0530) 7f851d5 build(deps-dev): bump js-yaml from 4.1.0 to 4.1.1 (react-native-webrtc#1773) ( dependabot[bot] 2026-05-10 01:28:56 +0800) fdc4771 build(deps-dev): bump @babel/plugin-transform-modules-systemjs (react-native-webrtc#1809) ( dependabot[bot] 2026-05-10 01:08:21 +0800) bc486df build(deps-dev): bump minimatch from 3.1.2 to 3.1.5 (react-native-webrtc#1791) ( dependabot[bot] 2026-04-30 14:40:03 +0800) f7b6382 ios: use runtime camera checks on simulator for camera availability ( Krzysztof Magiera 2026-04-14 12:31:59 +0200) 68ca776 pc: add RTCCertificate support ( xinfei.wu 2026-04-13 17:12:02 +0800) 643067f pc: add mediaConstraints on getDisplayMedia ( Frederic Luart 2026-04-09 16:45:22 +0200) a243f5e build(deps-dev): bump picomatch from 2.3.1 to 2.3.2 ( dependabot[bot] 2026-03-25 22:05:10 +0000) e36ddec build(deps-dev): bump flatted from 3.2.7 to 3.4.2 ( dependabot[bot] 2026-03-19 17:45:43 +0000) 43c665d style: make eslint happy ( wuxinfei 2026-03-13 20:57:18 +0800) 66e61ba chore: ignore src/vendor in eslint ( wuxinfei 2026-03-13 20:55:25 +0800) d6c7a40 chore: remove event-target-shim dependency from package-lock.json ( wuxinfei 2026-03-13 18:04:11 +0800) 495b416 refactor: update event-target-shim imports to use local vendor path ( wuxinfei 2026-03-13 17:55:32 +0800) c43189a refactor: replace defineEventAttribute with getter/setter methods for event attributes ( wuxinfei 2026-03-02 15:30:01 +0800) d2aa171 refactor: update event-target-shim imports to remove '/index' ( wuxinfei 2026-03-02 00:03:47 +0800) 5771fbd api: throw error in addIceCandidate when peer connection is closed ( naveenkirugulige 2026-03-04 16:22:50 +0530) 72f9dfd pc: add minBitrate to encoding parameters ( Martin Liu 2026-02-19 04:12:16 -0800) 5ba65ce android: fix ANR in getVideoTrackForStreamURL ( Saúl Ibarra Corretgé 2025-10-27 22:20:25 +0100)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.2.0 to 4.3.0. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@4.2.0...4.3.0) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 4.3.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Some hosts forward Activity results to every registered ActivityEventListener more than once (react-native-navigation is a common example). During the getDisplayMedia() screen-capture permission flow this makes onActivityResult fire twice for a single request: the first pass consumes displayMediaPromise (resolving it and nulling it) and the second pass calls resolve()/reject() on the now-null promise, crashing with a NullPointerException. It also spins up a second MediaProjection virtual display. Add null-guards so a duplicate dispatch is ignored: one at the top of the PERMISSION_REQUEST_CODE branch (covers the cancel path, which nulls the promise synchronously) and one at the top of createScreenStream() (covers the success path, since the single-threaded executor runs the duplicated callbacks in order).
The typescript target builds with `tsc --emitDeclarationOnly`, and tsc never
emits output for .d.ts inputs, so src/vendor/event-target-shim/index.d.ts never
made it into lib/typescript. Every `import from './vendor/event-target-shim'` in
the shipped declarations then failed to resolve, which silently stripped the
EventTarget members off our classes for consumers using the declaration files:
error TS2339: Property 'addEventListener' does not exist on type
'RTCPeerConnection'.
skipLibCheck (on by default in react-native's tsconfig) hides the resolution
error itself, so it only ever surfaced at the call sites.
The commonjs and module targets mishandle the same file in the other direction:
they compile every source file and rewrite the extension to .js, emitting an
index.d.js which holds no code and which nothing imports.
Fix both in a postbuild step, since bob 0.18.2 can neither copy extra files into
the typescript output nor exclude files from the babel targets.
Fixes react-native-webrtc#1830
…e-webrtc#1836) Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.24.3 to 4.28.8. - [Release notes](https://github.com/browserslist/browserslist/releases) - [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md) - [Commits](browserslist/browserslist@4.24.3...4.28.8) --- updated-dependencies: - dependency-name: browserslist dependency-version: 4.28.8 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…tive-webrtc#1835) Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.11 to 1.1.18. - [Release notes](https://github.com/juliangruber/brace-expansion/releases) - [Commits](juliangruber/brace-expansion@1.1.11...v1.1.18) --- updated-dependencies: - dependency-name: brace-expansion dependency-version: 1.1.18 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.3.0 to 4.3.2. - [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.2/CHANGELOG.md) - [Commits](nodeca/js-yaml@4.3.0...4.3.2) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 4.3.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
* Update WebRTC to M155 Adapt to the new RTCCryptoOptions initializer, the error-returning setCodecPreferences on both platforms, and raise the iOS minimum to 14.0. * Raise documented and example iOS deployment targets to 14.0 Matches the WebRTC M155 framework's minimum; the examples otherwise fail pod install against the new podspec.
70ab274 webrtc: Update WebRTC to M155 ( Jaya Allamsetty 2026-10-13 16:13:36 -0400) 7266a9b build(deps-dev): bump js-yaml from 4.3.0 to 4.3.2 ( dependabot[bot] 2026-09-09 20:35:22 +0000) 8f5428a build(deps-dev): bump brace-expansion from 1.1.11 to 1.1.18 (react-native-webrtc#1835) ( dependabot[bot] 2026-09-04 03:11:22 +0800) d062e9b build(deps-dev): bump browserslist from 4.24.3 to 4.28.8 (react-native-webrtc#1836) ( dependabot[bot] 2026-09-04 03:09:25 +0800) 014a8cf build: ship the vendored declarations in the typescript build ( Saúl Ibarra Corretgé 2026-07-31 11:59:46 +0200) 78d3094 fix(android): guard against duplicate onActivityResult in screen capture ( David Rodriguez 2026-07-29 08:17:31 -0500) 0483cc8 android: release intermediate video effect frames ( HanSeonWoo 2026-07-28 20:09:06 +0900) cf6101c build(deps-dev): bump js-yaml from 4.2.0 to 4.3.0 ( dependabot[bot] 2026-07-21 11:04:35 +0000)
This reverts commit 5892a0f.
423292b android: fix getDisplayMedia crash on API < 31 ( Calin-Teodor 2026-10-20 13:53:51 +0300) a5c66c7 Revert "ios(RCTWebRTC): enable Center Stage for devices that support it" ( Calin-Teodor 2026-10-20 13:28:06 +0300) d049d06 android(consumer-rules): cover SDK release builds who run R8 ( Calin-Teodor 2026-10-20 10:36:48 +0300)
Brings in the 30 upstream commits since e36ddec, the point the squash-merged #73 synced to. Merged with e36ddec as the base so the earlier syncs aren't re-resolved; upstream is now a real parent. Kept on our side: package name/version, libwebrtc 150 (android-prefixed and LiveKitWebRTC), iOS 12.0 library minimum. Upstream's new code is adapted to the livekit/LKRTC prefixes (certificates, setCodecPreferences error handling, simulator camera check). Screen capture keeps the size-change check alongside the new resolution scale. Our copy-vendor-types script is replaced by upstream's tools/postbuild.mjs. Lockfile keeps ours plus the brace-expansion and picomatch bumps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m switch (react-native-webrtc#1857) Brings in upstream 103af81. Only conflict was the import block: kept our livekit.org.webrtc imports and added the prefixed VideoFrame and VideoSink. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| return ThreadUtils | ||
| .submitToExecutor( | ||
| (Callable<VideoTrack>) () -> getUserMediaImpl.createVideoTrack(videoCaptureController)) | ||
| .get(); |
There was a problem hiding this comment.
[P1] createVideoTrack() can deadlock the WebRTC executor
This method submits creation to the single-threaded WebRTC executor and waits on .get(). If called from that executor, the submitted operation cannot run.
This is reachable through the public API: createStream() now invokes its success callback on the executor, and a native integration can create another track from that callback.
Please execute inline when already on the executor, or expose an asynchronous alternative. A focused Java probe reproduces the deadlock.
|
|
||
| public void registerTrack(AudioTrack track, AudioSource source) { | ||
| getUserMediaImpl.registerTrack(track, source); | ||
| ThreadUtils.runOnExecutor(() -> getUserMediaImpl.registerTrack(track, source)); |
There was a problem hiding this comment.
[P2] Registration became asynchronous while lookup remained synchronous
registerTrack() previously completed registration before returning. It now queues registration, while public getTrack() still reads directly on the caller’s thread. Consequently, registerTrack(track, source) followed by getTrack(-1, track.id()) can return null.
These lookups also access mutable local and remote registries outside their intended executor. Please define a consistent execution contract that preserves registration/lookup ordering and coordinates lookup with disposal. Concurrent collections alone would not resolve the ordering regression.
| .submitToExecutor( | ||
| (Callable<VideoTrack>) () -> getUserMediaImpl.createVideoTrack(videoCaptureController)) | ||
| .get(); | ||
| } catch (InterruptedException | ExecutionException e) { |
There was a problem hiding this comment.
[P2] Interrupted creation can leave an orphaned camera track
When .get() throws InterruptedException, the method returns null without restoring interruption or handling the submitted creation operation. That operation can still allocate and start a camera track that the caller never receives.
Please restore the interrupt status and cancel pending creation or clean up an abandoned result. Adding a timeout would require the same cleanup: stopping the wait does not stop the work.
Summary
Merges upstream react-native-webrtc up to 155.0.1. That brings in the 30 upstream commits made since our last sync (#73).
We stay on our libwebrtc 150 builds (
android-prefixed150.7871.04 andLiveKitWebRTC150.7871.04). Upstream's switch to Jitsi's M155 build is not taken. The package version is unchanged at 150.1.1; the release bump will be a separate change.This PR also includes an Android fix for a
ConcurrentModificationException(see "Also in this PR").Our earlier upstream syncs (#16, #24, #42, #73) were squash-merged. Git never recorded upstream as a parent, so every sync had to redo all conflict resolution since July 2024.
This branch fixes that.
8f25154is a real merge commit whose second parent is upstreamfb662c9(155.0.1). Squashing this PR would lose that link, and the next sync would start from scratch again.As a side effect, the commit list shows 78 upstream commits:
e36ddec..fb662c9. List them withgit log e36ddec..8f25154^2.The merge used
e36ddec(the upstream commit #73 synced to) as its base, so earlier resolutions were not redone.New from upstream
Features
RTCCertificatesupport:RTCPeerConnection.generateCertificate()andcertificatesinRTCConfiguration(Android and iOS).getDisplayMedia(constraints)(Android only):android.createConfigForDefaultDisplayandandroid.resolutionScale.Fixes
getDisplayMedia.getDisplayMediacrash on API < 31.onActivityResulttwice, e.g. with react-native-navigation.signalingStatebecomesclosedinstead ofconnectionState, so the finalsignalingstatechangeevent is delivered.setCodecPreferencesuses the error-reporting API on both platforms and logs failures.applyConstraints: keeps the currentfacingModewhen none is given. This doesn't change which camera is used here, since we already ignore camera changes inapplyConstraints(android,ios: disallow changing cameras through apply constraints #34).event-target-shimtype declarations now ship inlib/typescript(tools/postbuild.mjs).No net change: Center Stage (added, then reverted upstream); a duplicate
RTCRtpSenderglobal assignment removed (a later line already overwrote it); dependency bumps.Conflict resolution
Kept ours
Adapted upstream code to our prefixed SDK
livekit.org.webrtcimports forRtcCertificatePemandRtcError.LKRTCCertificateandLKRTCCameraVideoCapturer, plus<LiveKitWebRTC/RTCCertificate.h>imports.consumer-rules.pro):-dontwarnrule is ported as-dontwarn livekit.org.jni_zero.**.-keep class J.Nis skipped; that class doesn't exist in the prefixed artifact.Combined
ScreenCaptureController: upstream'sresolutionScale, plus our check that skips the format change when the size hasn't changed (android: only change capture format for screen if dimen actually changed #8).Replaced
scripts/copy-vendor-types.js(added in Merge upstream #73) is replaced by upstream'stools/postbuild.mjs. It fixes the same problem and also deletes the empty.d.jsfiles. Thebuildscript name is kept.package-lock.json: ours, plus the two upstream bumps we didn't have: brace-expansion → 1.1.21, picomatch → 2.3.2.Also in this PR
3d3a0c9android: fixConcurrentModificationExceptionfrom off-executorcreateStream.createVideoTrack,registerTrack,createStream) now run on the WebRTC executor, the only thread where the local stream and track maps are safe to touch.createVideoTrackblocks until the track is created.tmp/added to.gitignoreand.npmignore.Testing
Done (on the merge commit, before
3d3a0c9)npm run lint(eslint + tsc) and the build (bob build+ postbuild) pass.Android library sources compile with
javacagainst libwebrtc 150.iOS sources pass
clang -fsyntax-onlyagainst LiveKitWebRTC 150 (iOS simulator slice).Full Android and iOS builds, including an Android release build with R8 (ProGuard rules).
Android screen share: rotation,
resolutionScale, API < 31, quick start/stop.Codec preferences on both platforms: the preferred codec comes first in the offer.
Certificates: generate ECDSA and RSA, use one in a connection, and check the fingerprint matches the SDP.
pc.close(): calling it twice orgetStats()after close doesn't crash, and stopping tracks before or after close is safe.LiveKit room smoke test on iOS and Android: publish and subscribe, E2EE, encrypted data packets, the iOS audio session and CallKit, and
track.stop()releasing the camera.e2e-react-native tests run with no new failures.
🤖 Generated with Claude Code