jiti-meet/react/features/mobile/polyfills/RTCPeerConnection.js

22 lines
644 B
JavaScript
Raw Normal View History

// @flow
import { RTCPeerConnection as PC } from 'react-native-webrtc';
2016-12-17 10:03:10 +00:00
import { synthesizeIPv6Addresses } from './ipv6utils';
2016-12-17 10:03:10 +00:00
/**
* Override PeerConnection to synthesize IPv6 addresses.
2016-12-17 10:03:10 +00:00
*/
export default class RTCPeerConnection extends PC {
/**
* Synthesize IPv6 addresses before calling the underlying setRemoteDescription.
*
* @param {Object} description - SDP.
* @returns {Promise<undefined>} A promise which is resolved once the operation is complete.
*/
async setRemoteDescription(description: Object) {
return super.setRemoteDescription(await synthesizeIPv6Addresses(description));
2016-12-17 10:03:10 +00:00
}
}