question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React native + lib-jitsi-meet - RTCPeerConnection.js polyfill issue - media tracks not getting added

See original GitHub issue

Firstly, thanks to the entire Jitsi team and the community for such an awesome project.

Description:

Facing issue in integrating lib-jitsi-meet in react native. We are trying to build a react native jitsi meet client from scratch using lib-jitsi-meet. We are able to join the call, send and receive messages. But we are unable to send or receive media tracks. We are getting the following error:

TypeError: undefined is not an object (evaluating 'eventTarget[LISTENERS][type]')

We have drilled down the issue to the polyfill RTCPeerConnection.js. The log for the same is available here. As we can see in the logs, the error stack trace points to a set function in the RTCPeerConnection class.

We have tried to solve this with multiple approaches described below but to no avail.

You can find our repository here. For the purpose of this post, we can consider our self-hosted jitsi-meet to be located at jitsimeet.example.com. We are able to join the same conferences on both browser and jitsi-meet official mobile app without any issues. We are currently trying this only in android(react native app). We weren’t able to run the repo on ios after adding react-native-webrtc and we wanted to deal with it at another time.

We copied the whole polyfills folder from official Jitsi Meet repo and imported it in the index.js.

The first approach we tried is to downgrade react and react-native versions to what were being used in the official jitsi-meet repo which did not solve the issue and had the same log.

The second approach was in the webrtc.js polyfill, we directly used the RTCPeerConnection that was imported from react-native-webrtc. With this, we started seeing the mobile app camera stream on browser at jitsimeet.example.com/test1. On the mobile app, we are seeing an error(screenshot provided below). You can also find the log here.

The third approach we have tried is to rewrite the polyfill RTCPeerConnection.js as a class since we found a comment in RTCPeerConnection.js talking about not using class and extends due to a runtime error. The updated code for that is available at RTCPeerConnection2.js. With this we are getting an error(screenshot provided below). You can also find the log here.

Steps to reproduce:

  1. Clone the repo(https://github.com/s-xync/rn-jitsi-poc)
  2. npm i and npx react-native run-android
  3. Click on Go to class screen button.
  4. Check the errors on the screen and the logs in console.

Expected behavior:

Expected media tracks to be sent and received across all conference participants.

Actual behavior:

Media tracks from react native mobile app not being added. Throwing errors in RTCPeerConnection.js polyfill.

Any help on resolving this bug with the polyfill is greatly appreciated.

Thank you for your time.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rananajam1commented, Oct 2, 2020

@s-xync can you briefly explain the steps you took for integrating this into React-native app? TIA

0reactions
stale[bot]commented, Jul 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React native + lib-jitsi-meet - media tracks not getting added
We have drilled down the issue to the polyfill RTCPeerConnection.js. The log for the same is available here. As we can see in...
Read more >
React Native + lib-jitsi-meet - audio/video tracks not getting ...
On running the React Native part on the Android emulator, it is working fine (both joining the conference and rendering the audio/video tracks)....
Read more >
WebRTC API - MDN Web Docs - Mozilla
Interfaces. RTCPeerConnection. Represents a WebRTC connection between the local computer and a remote peer. It is used to handle efficient ...
Read more >
react-native-jitsi-meet-latu - npm
If you are using React-Native < 0.60, you should use a version < 2.0.0. For versions higher than 2.0.0, you need to add...
Read more >
node packages | Corvid by Wix
react -native-google-sheet. 0.0.5. available. 12/07/2022. @solana/web3.js. 1.41.3. available. 12/07/2022. puppeteer-extra-plugin-stealth. 2.10.0. available.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found