Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Setup Node
description: Setup Node from .nvmrc and install dependencies with npm
inputs:
node-version:
description: Optional Node version override
required: false
runs:
using: composite
steps:
- uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node-version }}
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
shell: bash
run: npm ci # respects .npmrc (legacy-peer-deps=true)
15 changes: 0 additions & 15 deletions .github/stale.yml

This file was deleted.

12 changes: 3 additions & 9 deletions .github/workflows/android_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@ jobs:
android-compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install node modules
run: npm install
- uses: ./.github/actions/setup-node

- name: Install example node modules
run: npm install
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm install
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-node
- name: Check if the git repository is clean
run: $(exit $(git status --porcelain --untracked-files=no | head -255 | wc -l)) || (echo "Dirty git tree"; git diff; exit 1)
- run: npm run lint
13 changes: 2 additions & 11 deletions .github/workflows/ios_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@ jobs:
ios-compile:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- uses: actions/checkout@v6
- uses: ./.github/actions/setup-node
- name: Cache cocoapods
uses: actions/cache@v4
with:
Expand All @@ -29,9 +23,6 @@ jobs:
restore-keys: |
${{ runner.os }}-pods-

- name: Install node modules
run: npm install

- name: Install example node modules
working-directory: ./examples/GumTestApp/
run: npm install
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release
on:
workflow_dispatch:
inputs:
dry_run:
description: Run release in "dry run" mode (does not publish)
default: false
type: boolean

permissions:
id-token: write # Required for npm Trusted Publishing (OIDC) + provenance
contents: write # Required to push the changelog/version commit + create the GH Release

jobs:
package_release:
name: Release from "${{ github.ref_name }}" branch
runs-on: ubuntu-latest
# GH does not allow limiting branches in workflow_dispatch settings, so guard here.
if: ${{ inputs.dry_run || github.ref_name == 'master' || github.ref_name == 'beta' || startsWith(github.ref_name, 'release') || endsWith(github.ref_name, '.x') }}
Comment on lines +14 to +19

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Branch guard is more permissive than semantic-release configuration.

Line 19 uses endsWith(github.ref_name, '.x'), which would allow branches like test.x or foo.x. However, .releaserc.json Line 3 expects numeric maintenance branches (1.x, 2.x, 1.0.x). This mismatch could allow releases from unintended branches.

🔒 Proposed fix to align with semantic-release branch patterns
-    if: ${{ inputs.dry_run || github.ref_name == 'master' || github.ref_name == 'beta' || startsWith(github.ref_name, 'release') || endsWith(github.ref_name, '.x') }}
+    if: ${{ inputs.dry_run || github.ref_name == 'master' || github.ref_name == 'beta' || startsWith(github.ref_name, 'release/') || contains(github.ref_name, '.x') && contains(github.ref_name, fromJSON('[0-9]')) }}

Or use a more precise regex check by adding a validation step before the release.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 14 - 19, The branch guard in the
package_release job is too permissive because the conditional uses
endsWith(github.ref_name, '.x'); update the check to only allow numeric
maintenance branches that match semantic-release (e.g., patterns like 1.x or
1.0.x) by replacing the simple endsWith check with a precise regex test against
github.ref_name (or add a validation step in the job that rejects non-numeric .x
branches), and ensure this aligns with the branch rules defined in
.releaserc.json so only branches matching the numeric maintenance pattern are
permitted to run the release.

steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # full history + tags required by semantic-release

- uses: ./.github/actions/setup-node

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
npx semantic-release
${{ inputs.dry_run && '--dry-run' || '' }}
33 changes: 33 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"master",
{ "name": "beta", "prerelease": true }
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{ "type": "refactor", "release": "patch" },
{ "scope": "deps", "release": "patch" }
]
Comment on lines +12 to +15

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

The deps scope rule may override type-based versioning.

Line 14 matches any commit with scope deps regardless of type. This means feat(deps): add feature would trigger a patch release instead of minor, potentially violating semver expectations. Consider adding a type constraint or documenting this intentional override.

📝 Alternative configuration if type-based versioning should be preserved
         "releaseRules": [
           { "type": "refactor", "release": "patch" },
-          { "scope": "deps", "release": "patch" }
+          { "type": "chore", "scope": "deps", "release": "patch" }
         ]

Or document the current behavior if intentional.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"releaseRules": [
{ "type": "refactor", "release": "patch" },
{ "scope": "deps", "release": "patch" }
]
"releaseRules": [
{ "type": "refactor", "release": "patch" },
{ "type": "chore", "scope": "deps", "release": "patch" }
]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.releaserc.json around lines 12 - 15, The releaseRules entry for scope
"deps" currently overrides type-based versioning (so commits like feat(deps):
... would be downgraded to patch); update the releaseRules array to either
narrow the rule by adding an explicit "type" constraint (for example add
"type":"chore" alongside "scope":"deps" and "release":"patch") or remove/replace
the scope-only rule and add a comment/documentation explaining the intended
behavior; target the "releaseRules" array and the rule object with
"scope":"deps" when making this change.

}
],
[
"@semantic-release/release-notes-generator",
{ "preset": "conventionalcommits" }
],
["@semantic-release/changelog", { "changelogFile": "CHANGELOG.md" }],
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "package.json", "package-lock.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}
66 changes: 9 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,19 @@

# React-Native-WebRTC

[![npm version](https://img.shields.io/npm/v/react-native-webrtc)](https://www.npmjs.com/package/react-native-webrtc)
[![npm downloads](https://img.shields.io/npm/dm/react-native-webrtc)](https://www.npmjs.com/package/react-native-webrtc)
[![Discourse topics](https://img.shields.io/discourse/topics?server=https%3A%2F%2Freact-native-webrtc.discourse.group%2F)](https://react-native-webrtc.discourse.group/)
[![npm version](https://img.shields.io/npm/v/@stream-io/react-native-webrtc)](https://www.npmjs.com/package/@stream-io/react-native-webrtc)
[![npm downloads](https://img.shields.io/npm/dm/@stream-io/react-native-webrtc)](https://www.npmjs.com/package/@stream-io/react-native-webrtc)

A WebRTC module for React Native.

## Feature Overview

| | Android | iOS | tvOS | macOS* | Windows* | Web* | Expo* |
| :- | :-: | :-: | :-: | :-: | :-: | :-: | :-: |
| Audio/Video | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | - | - | :heavy_check_mark: | :heavy_check_mark: |
| Data Channels | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: |
| Screen Capture | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: |
| Plan B | - | - | - | - | - | - | - |
| Unified Plan* | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: |
| Simulcast* | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: |

> **macOS** - We don't currently actively support macOS at this time.
Support might return in the future.

> **Windows** - We don't currently support the [react-native-windows](https://github.com/microsoft/react-native-windows) platform at this time.
Anyone interested in getting the ball rolling? We're open to contributions.

> **Web** - The [react-native-webrtc-web-shim](https://github.com/react-native-webrtc/react-native-webrtc-web-shim) project provides a shim for [react-native-web](https://github.com/necolas/react-native-web) support.
Which will allow you to use [(almost)](https://github.com/react-native-webrtc/react-native-webrtc-web-shim/tree/main#setup) the exact same code in your [react-native-web](https://github.com/necolas/react-native-web) project as you would with [react-native](https://reactnative.dev/) directly.

> **Expo** - As this module includes native code it is not available in the [Expo Go](https://expo.dev/client) app by default.
However you can get things working via the [expo-dev-client](https://docs.expo.dev/development/getting-started/) library and out-of-tree [config-plugins/react-native-webrtc](https://github.com/expo/config-plugins/tree/master/packages/react-native-webrtc) package.

> **Unified Plan** - As of version 106.0.0 Unified Plan is the only supported mode.
Those still in need of Plan B will need to use an older release.

> **Simulcast** - As of version 111.0.0 Simulcast is now possible with ease.
Software encode/decode factories have been enabled by default.

## WebRTC Revision

* Currently used revision: [M124](https://github.com/jitsi/webrtc/tree/M124)
* Supported architectures
* Android: armeabi-v7a, arm64-v8a, x86, x86_64
* iOS: arm64, x86_64
* tvOS: arm64
* macOS: arm64, x86_64
A WebRTC module for React Native tailored for the [`@stream-io/video-react-native-sdk`](https://github.com/GetStream/stream-video-js) needs.

## Getting Started

Use one of the following preferred package install methods to immediately get going.
Don't forget to follow platform guides below to cover any extra required steps.
Don't forget to follow platform guides below to cover any extra required steps.

**npm:** `npm install react-native-webrtc --save`
**yarn:** `yarn add react-native-webrtc`
**pnpm:** `pnpm install react-native-webrtc`
**npm:** `npm install @stream-io/react-native-webrtc --save`
**yarn:** `yarn add @stream-io/react-native-webrtc`
**pnpm:** `pnpm install @stream-io/react-native-webrtc`

## Guides

Expand All @@ -68,18 +29,9 @@ Don't forget to follow platform guides below to cover any extra required steps.
## Example Projects

We have some very basic example projects included in the [examples](./examples) directory.
Don't worry, there are plans to include a much more broader example with backend included.

## Community

Come join our [Discourse Community](https://react-native-webrtc.discourse.group/) if you want to discuss any React Native and WebRTC related topics.
Everyone is welcome and every little helps.

## Picture-in-Picture (PIP)

This package does not include a built-in PIP implementation. PIP support is available via [`@stream-io/video-react-native-sdk`](https://github.com/GetStream/stream-video-js).
Don't worry, there are plans to include a much more broader example with backend included.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix grammatical error: "much more broader" is incorrect.

The phrase "much more broader" uses a double comparative, which is grammatically incorrect. It should be either "much broader" or "a more comprehensive".

📝 Proposed fix
-Don't worry, there are plans to include a much more broader example with backend included.
+Don't worry, there are plans to include a much broader example with backend included.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Don't worry, there are plans to include a much more broader example with backend included.
Don't worry, there are plans to include a much broader example with backend included.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 32, The README contains the incorrect phrase "much more
broader"; update that sentence to use a correct comparative such as "much
broader" or "a more comprehensive example with backend included" to remove the
double comparative. Locate the sentence in README.md and replace "much more
broader example with backend included" with one of the suggested alternatives so
the grammar is corrected.


## Related Projects

Looking for extra functionality coverage?
The [react-native-webrtc](https://github.com/react-native-webrtc) organization provides a number of packages which are more than useful when developing Real Time Communication applications.
The [react-native-webrtc](https://github.com/react-native-webrtc) organization provides a number of packages which are more than useful when developing Real Time Communication applications.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add hyphen to compound adjective "Real Time Communication".

When "Real Time" modifies "Communication" as a compound adjective, it should be hyphenated as "Real-Time Communication" for correct English grammar.

📝 Proposed fix
-The [react-native-webrtc](https://github.com/react-native-webrtc) organization provides a number of packages which are more than useful when developing Real Time Communication applications.
+The [react-native-webrtc](https://github.com/react-native-webrtc) organization provides a number of packages which are more than useful when developing Real-Time Communication applications.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The [react-native-webrtc](https://github.com/react-native-webrtc) organization provides a number of packages which are more than useful when developing Real Time Communication applications.
The [react-native-webrtc](https://github.com/react-native-webrtc) organization provides a number of packages which are more than useful when developing Real-Time Communication applications.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~37-~37: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...ch are more than useful when developing Real Time Communication applications.

(EN_COMPOUND_ADJECTIVE_INTERNAL)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 37, Update the phrase "Real Time Communication" in
README.md to the hyphenated compound adjective "Real‑Time Communication"
wherever it modifies "Communication" (e.g., the sentence containing "provides a
number of packages which are more than useful when developing Real Time
Communication applications"); replace the unhyphenated occurrence with
"Real-Time Communication" to correct grammar.

Source: Linters/SAST tools

Loading
Loading