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.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
saghulcommented, Aug 30, 2019

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 😃

1reaction
fbruckhoffcommented, Nov 12, 2021

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What does it mean global namespace would be polluted?
In JavaScript, declarations outside of a function are in the global scope. Consider this small example:
Read more >
Is “Don't Pollute the Global Namespace” Still Good Advice in ...
The jQuery library used a $ sign as a global namespace (a namespace is just ... Example of global namespace pollution: var x...
Read more >
Lua: technical note 7 - Lua.org
This note describes a simple way to implement modules (also called packages) in Lua. The proposed method provides namespaces, privacy, ...
Read more >
JS tip - Avoiding polluting the global namespace - BigBinary
In the process of creating the calendar I created a bunch of utility functions that are available at global namespace. What are we...
Read more >
Work with global namespaces in Visual Basic - LINQ to XML
You can get an XNamespace object that corresponds to a global namespace using the GetXmlNamespace method. Example: Use Imports to declare a ...
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