Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use the shared sfu call object in react native #60

Merged
merged 41 commits into from
Nov 11, 2022

Conversation

santhoshvai
Copy link
Member

@santhoshvai santhoshvai commented Nov 9, 2022

Known issues

  • Video streams from android may not work all the time. As android sends vp9 codec support. This will be fixed by the backend later. Call between the web and android works though. In my test call between iOS and Android broke it.
  • joinWithCombinedStream and publishWithCombinedStream are temporary methods added to the SDK until we work on splitting audio and video streams on react-native.
  • back gestures break the video streaming screen
  • call leaving doesn't work reliably all the time (better to close and restart the app for now)
  • we don't fully use the shared state store yet. We await for the shared hooks repo to use it. For now only activeParticipants observable is used.

How to test the react-native app

Connect your android device or ios device with USB to your machine. Don't use emulators as video streams are not sent from there.

You need Xcode installed for iOS and/or Android SDK for running Android. Details: https://reactnative.dev/docs/environment-setup

Note: Running on iOS device may be prompt you with signing problems (contact me if so)

  • Run yarn, there is a manual patch that needs to be installed.
  • Run yarn build:client to build the js client
  • Move to cd packages/react-native-dogfood/
  • If using ios device. Run npx pod-install
  • If using android device. Run adb reverse tcp:8081 tcp:8081 to connect device.
  • Run npm install -g ios-deploy && npx react-native run-ios --device for iOS and/or yarn start android to run the app on your device

Open a call in the web dogfood app. Enter the same call-id on the react native app. You should receive the video streams on both sides 🤞

# Conflicts:
#	packages/client/src/rtc/Call.ts
#	packages/react-native-dogfood/src/components/Meeting/Meeting.tsx
#	packages/react-native-dogfood/src/contexts/AppContext.tsx
#	packages/react-native-dogfood/src/hooks/useCreateStreamVideoClient.ts
# Conflicts:
#	packages/client/src/rtc/Call.ts
@santhoshvai santhoshvai marked this pull request as ready for review November 9, 2022 11:59
packages/client/src/rpc/latency.ts Outdated Show resolved Hide resolved
packages/client/src/rpc/latency.ts Outdated Show resolved Hide resolved
packages/client/src/rtc/Call.ts Outdated Show resolved Hide resolved
packages/client/src/rtc/Call.ts Outdated Show resolved Hide resolved
packages/client/src/rtc/Call.ts Outdated Show resolved Hide resolved
packages/react-dogfood/pages/api/call/create.ts Outdated Show resolved Hide resolved
@vanGalilea
Copy link
Contributor

ANDROID ONLY - I found a bug:

  • join a call
  • leave a call
  • join a new call
  • the bug occurs: the local camera is black with no visible errors in the console

Comment on lines +1 to +12
diff --git a/src/RTCPeerConnection.ts b/src/RTCPeerConnection.ts
index 20de0069ce6137c1a10f65c2164084cf124c7ffe..46d89f399f65af135789b23ecd51258ce9df94f7 100644
--- a/src/RTCPeerConnection.ts
+++ b/src/RTCPeerConnection.ts
@@ -497,6 +497,7 @@ export default class RTCPeerConnection extends defineCustomEventTarget(...PEER_C

if (oldTransceiver) {
transceiver = oldTransceiver;
+ transceiver._receiver._track = new MediaStreamTrack(transceiver._receiver._track);
track = transceiver._receiver._track;
transceiver._mid = ev.transceiver.mid;
transceiver._currentDirection = ev.transceiver.currentDirection;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's create a PR in the RN webrtc lib.

@vanGalilea vanGalilea merged commit 1693d63 into main Nov 11, 2022
@vanGalilea vanGalilea deleted the feat/rn-use-shared-sfu-client branch November 11, 2022 08:33
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.

4 participants