2021-05-19 17:31:52 +02:00
|
|
|
import { RTCPeerConnection as PC } from 'react-native-webrtc';
|
2016-12-17 04:03:10 -06:00
|
|
|
|
2021-05-19 17:31:52 +02:00
|
|
|
import { synthesizeIPv6Addresses } from './ipv6utils';
|
2016-12-17 04:03:10 -06:00
|
|
|
|
|
|
|
|
/**
|
2021-05-19 17:31:52 +02:00
|
|
|
* Override PeerConnection to synthesize IPv6 addresses.
|
2016-12-17 04:03:10 -06:00
|
|
|
*/
|
2021-05-19 17:31:52 +02: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.
|
|
|
|
|
*/
|
2023-05-12 16:39:18 +03:00
|
|
|
async setRemoteDescription(description) {
|
2021-05-19 17:31:52 +02:00
|
|
|
return super.setRemoteDescription(await synthesizeIPv6Addresses(description));
|
2016-12-17 04:03:10 -06:00
|
|
|
}
|
|
|
|
|
}
|