react-native-webrtc / react-native-webrtc

The WebRTC module for React Native
https://react-native-webrtc.discourse.group
MIT License
4.63k stars 1.23k forks source link

Add registerGlobals() function to pollute global namespace with RTC entities #685

Closed ibc closed 5 years ago

ibc commented 5 years ago

As discussed here, there are some WebRTC based JS libraries that depend on RTCPeerConnection and so on being available in global namespace.

cordova-plugin-iosrtc exposes iosrtc.registerGlobals() for that.

So the only requirement is that react-native-webrtc is loaded first, then the app calls to registerGlobals() and then the 3rd party WebRTC library can be load.

danjenkins commented 5 years ago

Oh this is a nice idea.... But there are definitely other things that have to happen for jssip (for example) to work with rn-webrtc. This would be a nice step to remove some of the steps needed.

On Fri, 30 Aug 2019, 16:48 Iñaki Baz Castillo, notifications@github.com wrote:

As discussed here https://github.com/versatica/mediasoup-client/issues/5#issuecomment-526581786, there are some WebRTC based JS libraries that depend on RTCPeerConnection and so on being available in global namespace.

cordova-plugin-iosrtc exposes iosrtc.registerGlobals() https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/docs/iosrtc.md#iosrtcregisterglobals for that.

So the only requirement is that react-native-webrtc is loaded first, then the app calls to its registerGlobals() and then the 3rd party WebRTC library can be load.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/react-native-webrtc/react-native-webrtc/issues/685?email_source=notifications&email_token=AAB3LLKARI4IDCKJQBSU6DDQHEXMLA5CNFSM4ISOEV6KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HIPA6LQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB3LLP2LTP24OLGE7ZFHXLQHEXMLANCNFSM4ISOEV6A .

ibc commented 5 years ago

Which other things? (other than missing DTMF support)

danjenkins commented 5 years ago

Pranswer Vs answer is one of them. I need to investigate whether this is an issue on 1.75 (master) of rn-native. Check out my branch of jssip under nimble ape 's GitHub org to see the changes I've made.

About to fly home so will get you a more up to date list next week

On Fri, 30 Aug 2019, 19:12 Iñaki Baz Castillo, notifications@github.com wrote:

Which other things? (other than missing DTMF support)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/react-native-webrtc/react-native-webrtc/issues/685?email_source=notifications&email_token=AAB3LLIGFRTCWKZUEI4JG5TQHFIHLA5CNFSM4ISOEV6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5SHVQA#issuecomment-526678720, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB3LLIX33WNAEH6HNW5CH3QHFIHLANCNFSM4ISOEV6A .

saghul commented 5 years ago

Thanks for bringing this up @ibc! I agree, this would be a welcome addition. I'll try to get it done next week, if nobody beats me to it :-)

ashishvista commented 5 years ago

@saghul please make this addition. i need to use mediasoup client. It will be easier for us to start. Thank you.

ibc commented 5 years ago

PR #711

fbruckhoff commented 3 years ago

Hey, could use some help :) we've got a situation that looks like this:

1) A mediasoup/webRTC web app that runs in any browser. 2) An Expo-based React Native app to be installed on iOS and Android, which renders the web app (1) in a WebView.

Somehow webRTC doesn't work on iOS when embedded in a WebView, probably due to permission issues, so I'm trying to find out how to go about making use of react-native-webrtc to solve that problem.

Right now it's unclear to me how exactly react-native-webrtc would help in this situation. I realize we have to call registerGlobals(), but how would that trickle down properly to the WebView?

saghul commented 2 years ago

It's not possible to use this module inside a WebView.

fbruckhoff commented 2 years ago

Thanks @saghul, that makes sense.