Error calling JitsiMeetJS.createLocalTracks() in react native app


#1

i am incorporating lib-jitsi-meet into a react native app but I am getting an error when creating local tracks:

JitsiMeetJS.createLocalTracks()

The error is:

TypeError: r.getUserMedia is not a function

polyfills-browser.js:339

[modules/RTC/RTCUtils.js] <>: failed to obtain audio stream - stop

polyfills-browser.js:339

r {gum: Object, name: “gum.general”, message: “r.getUserMedia is not a function”, stack: “TypeError: r.getUserMedia is not a function at…”}

polyfills-browser.js:339

I import lib-jisti-meet.min from:

“lib-jitsi-meet”: “github:jitsi/lib-jitsi-meet#4a28a196160411d657518022de8bded7c02ad679”,

has anyone see this before?

Thanks


#2

In jitsi-meet the implementation of getUserMedia comes from react-native-webrtc and then gets polyfilled for the purposes of lib-jitsi-meet in react/features/base/lib-jitsi-meet/native/polyfills-webrtc.js. Please make sure that either you’re doing the polyfills yourself or better yet that you’re using the correct revision of react/features/base/lib-jitsi-meet/native/polyfills-webrtc.js that matches your lib-jitsi-meet.


#3

Zdravei ( your name looks very bulgarian :slight_smile: )

Thanks for your reply. I think i am using the right version of lib-jitsi-meet and polyfills-webrtc.js. I created a small project with ignite boilerplate to play with the library but still get the same error ( https://github.com/dgeorgiev06/myjitsimeet ). I am calling the jitsi meet api from a redux saga ( https://github.com/dgeorgiev06/myjitsimeet/blob/master/App/Sagas/ConnectionSagas.js ).

Do you have any other ideas what might be going on?

“lib-jitsi-meet”: “github:jitsi/lib-jitsi-meet#4a28a196160411d657518022de8bded7c02ad679”

and i copied polyfills-webrtc.js from the jitsi-meet repository

Thanks for your time


#4

The thing is that recently both jitsi-meet and lib-jitsi-meet got updated with respect to getUserMedia. I think you’re using lib-jitsi-meet before the update. Then you should be using a polyfills-webrtc.js from jitsi-meet which has a line mentioning getUserMedia explicitly. Once the WebRTC polyfill is correct and executes before lib-jitsi-meet tries to call the function there’s no reason for it to not exist.


#5

updating lib-jitsi-meet and the polyfills file did it, thanks!!