Home > sip.js > SessionDescriptionHandler > peerConnectionDelegate
A delegate which provides access to the peer connection event handlers.
Signature:
get peerConnectionDelegate(): PeerConnectionDelegate | undefined;
set peerConnectionDelegate(delegate: PeerConnectionDelegate | undefined);
Use the peerConnectionDelegate to get access to the events associated with the RTCPeerConnection. For example...
Do NOT do this...
peerConnection.onicecandidate = (event) => {
// do something
};
Instead, do this...
peerConnection.peerConnectionDelegate = {
onicecandidate: (event) => {
// do something
}
};
Setting the peer connection event handlers directly is not supported and may break this class. As this class depends on exclusive access to them. This delegate is intended to provide access to the RTCPeerConnection events in a fashion which is supported.