Kurento Utils for React Native

366 views
Skip to first unread message

Isuru Sahan

unread,
Sep 21, 2018, 5:32:26 AM9/21/18
to kurento
  • I want to use kurento util with react native.
  • I install it using npm i react-native-kurento-utils
  • After that I used this

    let webrtc = new WebRtcPeer.WebRtcPeerSendrect(options, fn)
    

I am getting:

'can't find variable: WebRtcPeer' Error

Do I need to add anything in import?


Neil Young

unread,
Sep 21, 2018, 7:17:04 AM9/21/18
to kurento
I'm using it from react-static. Importing it like so

let WebRtcPeer
if (typeof window !== 'undefined') {
WebRtcPeer = require('kurento-utils').WebRtcPeer
}

Maybe "import" does work too, but now on my side, since the release build is resolving window relatively late (after all imports)

Then you seem to have a typo and IMHO new is not required either. This works:

this.webRtcPeer = WebRtcPeer.WebRtcPeerSendrecv(options, (error, stream) => {
...

Neil Young

unread,
Sep 21, 2018, 7:17:35 AM9/21/18
to kurento
Typo. Read "now" as "not"

Isuru Sahan

unread,
Sep 21, 2018, 1:27:33 PM9/21/18
to kurento
Hi Neil thanks for this. I want another question 
I want to create react native project with kurento. I need to connect react native to KMS one to many Demo.
Do you have any experience or idea to how to do this. it will be great help with any thing you know 

Neil Young

unread,
Sep 21, 2018, 1:38:58 PM9/21/18
to kurento
No, unfortunately no experience with this, sorry

Andrew Costa

unread,
Sep 21, 2018, 2:09:42 PM9/21/18
to kurento
You don't need kurento utils to establish a connection with kurento. You can use plain javascript. I don't have experience doing webrtc in react native, but you may want to start by looking for a react-native webrtc library.

Isuru Sahan

unread,
Sep 22, 2018, 11:15:46 PM9/22/18
to kurento
Thanks Andrew. But when we use kurento utils we can do it less codes right?

Isuru Sahan

unread,
Sep 22, 2018, 11:18:40 PM9/22/18
to kurento
Hi Neil i will continue my question here when I have questions regarding kurento.I need to use data channels and recording in one to many demo. It is possible right?
Reply all
Reply to author
Forward
0 new messages