diff --git a/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js b/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js index 2c5aa7969..5800c3f99 100644 --- a/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js +++ b/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js @@ -1,8 +1,6 @@ +import { NativeModules } from 'react-native'; import { RTCPeerConnection, RTCSessionDescription } from 'react-native-webrtc'; -import { Platform } from '../../react'; -import { POSIX } from '../../react-native'; - // XXX At the time of this writing extending RTCPeerConnection using ES6 'class' // and 'extends' causes a runtime error related to the attempt to define the // onaddstream property setter. The error mentions that babelHelpers.set is @@ -169,7 +167,7 @@ function _setRemoteDescription(sessionDescription) { function _synthesizeIPv6Addresses(sdp) { // The synthesis of IPv6 addresses is implemented on iOS only at the time of // this writing. - if (Platform.OS !== 'ios') { + if (!NativeModules.POSIX) { return Promise.resolve(sdp); } @@ -199,6 +197,7 @@ function _synthesizeIPv6Addresses0(sessionDescription) { let start = 0; const lines = []; const ips = new Map(); + const getaddrinfo = NativeModules.POSIX.getaddrinfo; do { const end = sdp.indexOf('\r\n', start); @@ -237,7 +236,7 @@ function _synthesizeIPv6Addresses0(sessionDescription) { if (v && typeof v === 'string') { resolve(v); } else { - POSIX.getaddrinfo(ip).then( + getaddrinfo(ip).then( value => { if (value.indexOf(':') === -1 || value === ips.get(ip)) { diff --git a/react/features/base/react-native/POSIX.js b/react/features/base/react-native/POSIX.js deleted file mode 100644 index 49138601d..000000000 --- a/react/features/base/react-native/POSIX.js +++ /dev/null @@ -1,3 +0,0 @@ -import { NativeModules } from 'react-native'; - -export default NativeModules.POSIX; diff --git a/react/features/base/react-native/index.js b/react/features/base/react-native/index.js deleted file mode 100644 index 0690ec17f..000000000 --- a/react/features/base/react-native/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default as POSIX } from './POSIX';