Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
0de86c6
Update WebRTCModule+RTCDataChannel.m
fmorau Oct 4, 2022
a143523
fix: yarn issue with types
fmorau Oct 4, 2022
c638b5b
chore: added react-native devDependency
fmorau Oct 4, 2022
c0a6285
Merge branch 'react-native-webrtc:master' into master
fmorau Oct 5, 2022
0306643
chore: update android to handle buffers from Web
fmorau Oct 7, 2022
3f3ba00
fix: streamReactTag reset issue
fmorau Oct 7, 2022
2cc823d
fix: video tracks usage
fmorau Oct 12, 2022
83fd18f
fix: rollback some changes which are not finalised
fmorau Oct 13, 2022
09477fb
fix: issue
fmorau Oct 13, 2022
4429106
fix: android issues
fmorau Oct 14, 2022
e5aaf93
chore: update react-native
fmorau Nov 14, 2022
683e66e
chore: remove react-native, remove build
fmorau Nov 17, 2022
9711a4a
fix: package.json
fmorau Nov 17, 2022
b085125
Revert "fix: package.json"
fmorau Nov 17, 2022
298cc89
Revert "chore: remove react-native, remove build"
fmorau Nov 17, 2022
be67c3a
fix: build
fmorau Nov 17, 2022
0347843
fix-conflicts
TuTejsy Dec 29, 2022
614dd87
enable blur backgorund on iOS & Android
TuTejsy Jan 19, 2023
becdc3a
fix performance
TuTejsy Jan 19, 2023
97dcad3
chore: added org.webrtc:google-webrtc to build.gradle
fmorau Apr 19, 2024
a75f700
Revert "chore: added org.webrtc:google-webrtc to build.gradle"
fmorau Apr 19, 2024
b1fb3f3
Merge branch 'master' into story/m-1814/upgrade-react-native-webrtc
fmorau Oct 7, 2024
bb0aa88
fix: didReceiveMessageWithBuffer
fmorau Oct 9, 2024
2cb0681
feat: Add audio session manager and handle close connection
iosDeveloperDenis Dec 4, 2024
b213ae6
Merge pull request #3 from sharekey/new-audio-session
fmorau Dec 16, 2024
f00335b
Merge branch 'dev' into blur-video-background-poc
iosDeveloperDenis Dec 18, 2024
3fcdf7b
Update yarn.lock
iosDeveloperDenis Dec 18, 2024
fb66686
Update package-lock.json
iosDeveloperDenis Dec 18, 2024
1a4d2a6
merge: story/m-1814/upgrade-react-native-webrtc
iosDeveloperDenis Dec 18, 2024
bc17cba
feat: Add native recognizer
iosDeveloperDenis Dec 19, 2024
aeb335f
fix: Imports
iosDeveloperDenis Dec 26, 2024
5c1d64a
fix: create video track with background effect
basart Dec 26, 2024
fa35007
change version
iosDeveloperDenis Dec 26, 2024
528f3f3
fix: createVideoTrack of WebRTCModule
basart Dec 26, 2024
961575a
Merge branch 'blur-video-background-poc' into fix-blur-video-backgrou…
basart Dec 26, 2024
b6afbfa
fix: update media track constraints type
basart Dec 26, 2024
9f89cfa
Update build.gradle
basart Dec 26, 2024
785247a
change order
iosDeveloperDenis Dec 26, 2024
a1d0470
inc version
iosDeveloperDenis Dec 26, 2024
4ead2e6
remove cycle link
iosDeveloperDenis Dec 26, 2024
57c164c
fix: extract backgroundImageBase64 from videoContraints
basart Dec 26, 2024
79ec33f
Merge branch 'blur-video-background-poc' into fix-blur-video-backgrou…
basart Dec 26, 2024
e0121e6
add change background method for ios
iosDeveloperDenis Dec 27, 2024
05c73d9
fix import
iosDeveloperDenis Dec 27, 2024
bf32d96
Revert "fix: extract backgroundImageBase64 from videoContraints"
basart Dec 27, 2024
2f74065
Merge branch 'blur-video-background-poc' into fix-blur-video-backgrou…
basart Dec 27, 2024
65f5d36
.
basart Dec 27, 2024
ad02abb
.
basart Dec 27, 2024
bcadbe1
fix: background effect constraints type usage
basart Dec 27, 2024
5b9a68d
fix data channel
iosDeveloperDenis Dec 28, 2024
bf828eb
remove logs
iosDeveloperDenis Dec 28, 2024
4064baa
Merge branch 'fix-blur-video-background-poc' into blur-video-backgrou…
iosDeveloperDenis Dec 28, 2024
bfcaf6f
Merge pull request #4 from sharekey/blur-video-background-poc
iosDeveloperDenis Dec 28, 2024
a9557d6
add delay for bridging message
iosDeveloperDenis Dec 29, 2024
1bdf840
fix bridging message
iosDeveloperDenis Dec 29, 2024
d3f4e6f
Merge pull request #7 from sharekey/bridge-fix
fmorau Dec 30, 2024
f0c0f75
remove CoreAuio
iosDeveloperDenis Dec 30, 2024
33d21af
update webrtc
iosDeveloperDenis Jan 8, 2025
088f847
revert
iosDeveloperDenis Jan 9, 2025
5d9cd70
feature: made MediaStreamTrackInfo kind more specific
fmorau Jan 14, 2025
5ff75f3
Update react-native-webrtc.podspec
iosDeveloperDenis Jan 16, 2025
0c47d6b
Merge pull request #9 from sharekey/fix-podspec
fmorau Jan 16, 2025
ce2a061
fix: Android reconnect after network lost
iosDeveloperDenis Jan 22, 2025
28b7371
Merge pull request #11 from sharekey/bug/m-1946/android-calls-impossi…
iosDeveloperDenis Jan 24, 2025
e15c293
fix: Video orientation on android
iosDeveloperDenis Feb 4, 2025
466b52b
Merge pull request #13 from sharekey/bug/m-1945/calls-video-from-back…
iosDeveloperDenis Feb 7, 2025
0df0ac9
enable horizontal mode on ios
iosDeveloperDenis Feb 14, 2025
2b6b87e
remove notification
iosDeveloperDenis Feb 14, 2025
8f2a3f0
fix: Landscape and image background
iosDeveloperDenis Feb 19, 2025
6150c20
fix: Mirroring
iosDeveloperDenis Mar 6, 2025
67d6137
add files
iosDeveloperDenis Jul 11, 2025
a4c464f
fix: Output voice detection
iosDeveloperDenis Jul 12, 2025
dad2c20
fix
iosDeveloperDenis Jul 14, 2025
c6e74f7
fix: Android
iosDeveloperDenis Jul 15, 2025
8a10f84
fix
iosDeveloperDenis Jul 15, 2025
285efd3
fix
iosDeveloperDenis Jul 15, 2025
6002a18
fix
iosDeveloperDenis Jul 16, 2025
43a2eff
fix ios
iosDeveloperDenis Jul 17, 2025
a409f56
chore: removed examples
fmorau Jul 24, 2025
192c152
fix: dataChannel message corruption
basart Aug 19, 2025
1c442fc
Merge pull request #20 from sharekey/bug/m-1944/calls-video-of-one-of…
basart Sep 2, 2025
71091d6
Merge pull request #15 from sharekey/story/m-2209/highlight-speaking-…
basart Sep 2, 2025
7c2412e
fix: App freezing
iosDeveloperDenis Sep 16, 2025
34a6410
Merge pull request #22 from sharekey/bug/m-2368/samsung-z-fold-turnin…
iosDeveloperDenis Sep 17, 2025
9bc5704
fix: Optimization audio session closing
iosDeveloperDenis Dec 2, 2025
17d861d
fix: Missing import
iosDeveloperDenis Dec 2, 2025
0ef6137
Merge pull request #24 from sharekey/story/m-2398/add-peerconnection-…
iosDeveloperDenis Jan 15, 2026
15e4f2a
add logs fore measure code execution
iosDeveloperDenis Jan 15, 2026
39c8537
add logs and fix issue with sound
iosDeveloperDenis Jan 28, 2026
18a5a8b
Merge pull request #25 from sharekey/bug/m-2582/user-hears-participan…
fmorau Mar 26, 2026
06894cb
feature: upgrade for latest rn, new arch and android 16kb page support
fmorau Mar 26, 2026
6b11282
fix: Check null before use objects and add runOnExecutor
iosDeveloperDenis Apr 15, 2026
480ec17
fix: Comments
iosDeveloperDenis Apr 15, 2026
a6b0a6e
Merge pull request #26 from sharekey/bug/m-2740/android--app-stuck-an…
fmorau Apr 28, 2026
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
Binary file added android/.gradle/7.4/checksums/checksums.lock
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added android/.gradle/7.4/fileChanges/last-build.bin
Binary file not shown.
Binary file added android/.gradle/7.4/fileHashes/fileHashes.lock
Binary file not shown.
Empty file.
Empty file.
5 changes: 5 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ dependencies {
implementation 'com.facebook.react:react-native:+'
api 'org.jitsi:webrtc:124.+'
implementation "androidx.core:core:1.7.0"

implementation "com.google.android.gms:play-services-tasks:18.2.0"
implementation "com.google.android.gms:play-services-mlkit-face-detection:17.1.0"
implementation "com.google.mlkit:segmentation-selfie:16.0.0-beta6"
implementation "com.google.mlkit:camera:16.0.0-beta3"
}
8 changes: 8 additions & 0 deletions android/local.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Tue Jan 03 11:44:06 MSK 2023
sdk.dir=/Users/vasil/Library/Android/sdk
3 changes: 3 additions & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
package="com.oney.WebRTCModule"
xmlns:tools="http://schemas.android.com/tools"
>

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application>
<service
android:name=".MediaProjectionService"
Expand Down
46 changes: 24 additions & 22 deletions android/src/main/java/com/oney/WebRTCModule/DataChannelWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,33 @@ public void onBufferedAmountChange(long amount) {

@Override
public void onMessage(DataChannel.Buffer buffer) {
WritableMap params = Arguments.createMap();
params.putString("reactTag", reactTag);
params.putInt("peerConnectionId", peerConnectionId);

byte[] bytes;
if (buffer.data.hasArray()) {
bytes = buffer.data.array();
} else {
bytes = new byte[buffer.data.remaining()];
buffer.data.get(bytes);
final byte[] copiedBytes;
try {
if (buffer.data.hasArray()) {
int offset = buffer.data.arrayOffset() + buffer.data.position();
int length = buffer.data.remaining();
copiedBytes = new byte[length];
System.arraycopy(buffer.data.array(), offset, copiedBytes, 0, length);
} else {
copiedBytes = new byte[buffer.data.remaining()];
buffer.data.get(copiedBytes);
}
} finally {
buffer.data.rewind();
}

String type;
String data;
if (buffer.binary) {
type = "binary";
data = Base64.encodeToString(bytes, Base64.NO_WRAP);
} else {
type = "text";
data = new String(bytes, StandardCharsets.UTF_8);
}
params.putString("type", type);
params.putString("data", data);
ThreadUtils.runOnExecutor(() -> {
WritableMap params = Arguments.createMap();
params.putString("reactTag", reactTag);
params.putInt("peerConnectionId", peerConnectionId);

String type = "text";
String data = new String(copiedBytes, StandardCharsets.UTF_8);
params.putString("type", type);
params.putString("data", data);

webRTCModule.sendEvent("dataChannelReceiveMessage", params);
webRTCModule.sendEvent("dataChannelReceiveMessage", params);
});
}

@Override
Expand Down
27 changes: 18 additions & 9 deletions android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import android.content.Context;
import android.content.Intent;
import android.media.projection.MediaProjectionManager;
import android.os.Handler;
import android.os.Looper;
import android.util.DisplayMetrics;
import android.util.Log;
import androidx.core.util.Consumer;
Expand Down Expand Up @@ -195,7 +197,7 @@ void getUserMedia(final ReadableMap constraints, final Callback successCallback,
CameraCaptureController cameraCaptureController =
new CameraCaptureController(reactContext.getCurrentActivity(), getCameraEnumerator(), videoConstraintsMap);

videoTrack = createVideoTrack(cameraCaptureController);
videoTrack = createVideoTrack(cameraCaptureController, videoConstraintsMap.hasKey("enableVirtualBackgroud"), videoConstraintsMap.hasKey("enableBlurBackgroud"), videoConstraintsMap.getString("backgroundImageBase64"));
}

if (audioTrack == null && videoTrack == null) {
Expand Down Expand Up @@ -362,12 +364,12 @@ private VideoTrack createScreenTrack() {
DisplayMetrics displayMetrics = DisplayUtils.getDisplayMetrics(reactContext.getCurrentActivity());
int width = displayMetrics.widthPixels;
int height = displayMetrics.heightPixels;
ScreenCaptureController screenCaptureController = new ScreenCaptureController(
reactContext.getCurrentActivity(), width, height, mediaProjectionPermissionResultData);
return createVideoTrack(screenCaptureController);
ScreenCaptureController screenCaptureController
= new ScreenCaptureController(reactContext.getCurrentActivity(), width, height, mediaProjectionPermissionResultData);
return createVideoTrack(screenCaptureController, null, false, "");
}

VideoTrack createVideoTrack(AbstractVideoCaptureController videoCaptureController) {
VideoTrack createVideoTrack(AbstractVideoCaptureController videoCaptureController, Boolean enableVirtualBackgroud, Boolean enableBlurBackgroud, String backgroundImageBase64) {
videoCaptureController.initializeVideoCapturer();

VideoCapturer videoCapturer = videoCaptureController.videoCapturer;
Expand All @@ -392,12 +394,19 @@ VideoTrack createVideoTrack(AbstractVideoCaptureController videoCaptureControlle
VideoSource videoSource = pcFactory.createVideoSource(videoCapturer.isScreencast());
videoCapturer.initialize(surfaceTextureHelper, reactContext, videoSource.getCapturerObserver());

VideoTrack track = pcFactory.createVideoTrack(id, videoSource);
if (enableVirtualBackgroud || enableBlurBackgroud) {
VideoProcessor p = new VirtualBackgroundVideoProcessor(reactContext, surfaceTextureHelper, enableVirtualBackgroud, enableBlurBackgroud, backgroundImageBase64);
videoSource.setVideoProcessor(p);
}

track.setEnabled(true);
tracks.put(id, new TrackPrivate(track, videoSource, videoCaptureController, surfaceTextureHelper));
String videoTrackId = UUID.randomUUID().toString();
VideoTrack track = pcFactory.createVideoTrack(videoTrackId, videoSource);

videoCaptureController.startCapture();
track.setEnabled(true);
tracks.put(videoTrackId, new TrackPrivate(track, videoSource, videoCaptureController, surfaceTextureHelper));

// Delay fix issue with app freezing on fold devices
new Handler(Looper.getMainLooper()).postDelayed(videoCaptureController::startCapture, 250);

return track;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,35 @@ PeerConnection getPeerConnection() {
return peerConnection;
}

int getId() {
return id;
}

void setPeerConnection(PeerConnection peerConnection) {
this.peerConnection = peerConnection;
}

void close() {
Log.d(TAG, "PeerConnection.close() for " + id);

peerConnection.close();
PeerConnection pc = peerConnection;
if (pc == null) {
return;
}

pc.close();
}

void dispose() {
Log.d(TAG, "PeerConnection.dispose() for " + id);

PeerConnection pc = peerConnection;
if (pc == null) {
return;
}
// Make future calls observe disposal immediately.
peerConnection = null;

// Remove video track adapters
for (MediaStreamTrack track : this.remoteTracks.values()) {
if (track instanceof VideoTrack) {
Expand All @@ -87,7 +103,7 @@ void dispose() {
// At this point there should be no local MediaStreams in the associated
// PeerConnection. Call dispose() to free all remaining resources held
// by the PeerConnection instance (RtpReceivers, RtpSenders, etc.)
peerConnection.dispose();
pc.dispose();

remoteStreamIds.clear();
remoteStreams.clear();
Expand Down Expand Up @@ -470,7 +486,9 @@ public void onAddTrack(final RtpReceiver receiver, final MediaStream[] mediaStre
* semantics are specified. The transceiver will be disposed automatically.
*/
@Override
public void onTrack(final RtpTransceiver transceiver) {}
public void onTrack(final RtpTransceiver transceiver) {
Log.w(TAG, "PeerConnection didStartReceivingOnTransceiver" + transceiver.getReceiver().id());
}

/*
* Triggered when a previously added remote track is removed by the remote
Expand Down
Loading
Loading