You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RTCPeerConnection.js 644B

123456789101112131415161718192021
  1. // @flow
  2. import { RTCPeerConnection as PC } from 'react-native-webrtc';
  3. import { synthesizeIPv6Addresses } from './ipv6utils';
  4. /**
  5. * Override PeerConnection to synthesize IPv6 addresses.
  6. */
  7. export default class RTCPeerConnection extends PC {
  8. /**
  9. * Synthesize IPv6 addresses before calling the underlying setRemoteDescription.
  10. *
  11. * @param {Object} description - SDP.
  12. * @returns {Promise<undefined>} A promise which is resolved once the operation is complete.
  13. */
  14. async setRemoteDescription(description: Object) {
  15. return super.setRemoteDescription(await synthesizeIPv6Addresses(description));
  16. }
  17. }