[react-native] Cannot read property 'addstream' of undefined

Hi! And thanks for this awesome package.

I’ve been trying for some weeks to integrate lib-jitsi-meet into our react-native app. It seems that I’m very close to getting it done but failing because of some detail that I can’t find.

I can establish connection successfully and enter a room, but no remote tracks are received. Upon entering, this error pops up:

2020-10-22T18:37:31.277Z [JitsiConference.js] <ie._acceptJvbIncomingCall>:  TypeError: Cannot read property 'addstream' of undefined
    at setAttributeListener (custom-event-target.js:54)
    at _RTCPeerConnection.set [as onaddstream] (custom-event-target.js:110)
    at new _RTCPeerConnection (RTCPeerConnection.js:44)
    at new A (lib-jitsi-meet-jitsi.min.js:17)
    at A.createPeerConnection (lib-jitsi-meet-jitsi.min.js:1)
    at w.doInitialize (lib-jitsi-meet-jitsi.min.js:1)
    at w.initialize (lib-jitsi-meet-jitsi.min.js:17)
    at ie._acceptJvbIncomingCall (lib-jitsi-meet-jitsi.min.js:10)
    at ie.onIncomingCall (lib-jitsi-meet-jitsi.min.js:10)
    at a.emit (lib-jitsi-meet-jitsi.min.js:1)
    at g.onJingle (lib-jitsi-meet-jitsi.min.js:10)
    at I.Handler.run (lib-jitsi-meet-jitsi.min.js:1)
    at lib-jitsi-meet-jitsi.min.js:1
    at Object.forEachChild (lib-jitsi-meet-jitsi.min.js:1)
    at I.Connection._dataRecv (lib-jitsi-meet-jitsi.min.js:1)
    at D.Bosh._onRequestStateChange (lib-jitsi-meet-jitsi.min.js:1)
    at EventTarget.dispatchEvent (event-target-shim.js:818)
    at EventTarget.setReadyState (XMLHttpRequest.js:566)
    at EventTarget.__didCompleteResponse (XMLHttpRequest.js:388)
    at XMLHttpRequest.js:501
    at RCTDeviceEventEmitter.emit (EventEmitter.js:189)
    at MessageQueue.__callFunction (MessageQueue.js:436)
    at MessageQueue.js:111
    at MessageQueue.__guard (MessageQueue.js:384)
    at MessageQueue.callFunctionReturnFlushedQueue (MessageQueue.js:110)
    at debuggerWorker.js:69

Seems to be something with the RTCPeerConnection polyfill, already tried messing up with that with no luck. I’ve copied all polyfills under /features/mobile/polyfills from the jitsi-meet app. Is there anything else I should be looking for?

Using jitsi-meet app to connect to our backend works flawlessly.

Environment:
react-native: 0.61.5
lib-jitsi-meet: commit de57cdfb6f2ac422901ade3cf0b4e130144c45ca from earlier this week
react-native-webrtc": 1.75.3

Config used (I think it shouldn’t matter because I used the same to test on jitsi-meet app):

  options = {
    hosts: {
      domain: 'xxx.yyy.com',
      muc: 'conference.xxx.yyy.com',
    },
    bosh: 'https://xxx.yyy.com/http-bind',
    clientNode: 'http://jitsi.org/jitsimeet',
    testing: {
      p2pTestMode: false,
    },
    enableNoAudioDetection: true,
    enableNoisyMicDetection: true,
    resolution: 720,
    constraints: {
      video: {
        height: {
          ideal: 720,
          max: 720,
          min: 240,
        },
      },
    },
    channelLastN: -1,
    openBridgeChannel: true,
    enableWelcomePage: false,
    enableUserRolesBasedOnToken: false,
    p2p: {
      enabled: true,
      stunServers: [
        { urls: 'stun:meet-jit-si-turnrelay.jitsi.net:443' },
      ],
    },
    makeJsonParserHappy: 'even if last key had a trailing comma',
  };

Thanks in advance!

Just updated react-native-webrtc to 1.84.0 but the error persists

I’ve reproduced the same error on a clean repo (https://github.com/thiagobrez/react-native-jitsi-test).

Installed lib-jitsi-meet and its dependencies, and added a textinput and button to connect to a room, using jitsi beta servers.

Could anyone take a look?
@saghul

Thanks in advance.

1 Like