You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @desc Creates a new RTCPeerConnection object, which represents a WebRTC connection between the local device and a remote peer and adds event listeners to it
192
+
* @function createPeer - Creates a new RTCPeerConnection object, which represents a WebRTC connection between the local device and a remote peer and adds event listeners to it
payload: (_a=peerRef.current)===null||_a===void0 ? void0 : _a.localDescription// localDescription is an RTCSessionDescription describing the session for the local end of the connection
308
306
};
309
307
ws.current.send(JSON.stringify(answerPayload));
310
308
});
311
309
}
312
310
/**
313
-
* @desc The local client's remote description is set as the incoming Answer SDP to define who we are trying to connect to on the other end of the connection.
314
-
* @param {object} data SDP answer
311
+
* @function handleAnswer - The local client's remote description is set as the incoming Answer SDP to define who we are trying to connect to on the other end of the connection.
* @desc As the local client's ICE Candidates are being generated, they are being sent to the remote client to complete the connection
323
-
* @param {RTCPeerConnectionIceEvent} e
320
+
* @function handleIceCandidateEvent As the local client's ICE Candidates are being generated, they are being sent to the remote client to complete the connection
321
+
* @param {RTCPeerConnectionIceEvent} e
324
322
*/
325
323
functionhandleIceCandidateEvent(e){
326
324
if(e.candidate){// Contains the RTCIceCandidate containing the candidate associated with the event,
* @desc ICE Candidates being sent from each end of the connection are added to a list of potential connection methods until both ends have a way of connecting to eachother
337
-
* @param {Object} data containing a property payload with an incoming ICE Candidate
334
+
* @function handleNewIceCandidate ICE Candidates being sent from each end of the connection are added to a list of potential connection methods until both ends have a way of connecting to eachother
335
+
* @param {Object} data containing a property payload with an incoming ICE Candidate
* @desc Once the connection is made, the RTCRtpReceiver interface is exposed and this function is then able to extract the MediaStreamTrack from the sender's RTCPeerConnection.
346
-
* @param {RTCTrackEvent} e An Event Object, also contains the stream
343
+
* @function handleTrackEvent - Once the connection is made, the RTCRtpReceiver interface is exposed and this function is then able to extract the MediaStreamTrack from the sender's RTCPeerConnection.
344
+
* @param {RTCTrackEvent} e An Event Object, also contains the stream
347
345
*/
348
346
functionhandleTrackEvent(e){
349
347
remoteVideo.current.srcObject=e.streams[0];
350
348
}
351
349
/**
352
-
* @desc Enables screen sharing using MediaSession.getDisplayMedia()
350
+
* @function shareScreen - Enables screen sharing using MediaSession.getDisplayMedia()
353
351
*/
354
352
functionshareScreen(){
355
353
//TODOS: On a new connection the local and streamed screen bugs producing: Rtconnect.jsx:273 Uncaught (in promise) DOMException: The peer connection is closed.
* @desc if any client chooses to end their call then the person who ends the call first closes their connection and resets the remote video component while also sending a message to the remote peer to also go through the same process.
371
-
* @param {boolean} isEnded
368
+
* @function endCall - if any client chooses to end their call then the person who ends the call first closes their connection and resets the remote video component while also sending a message to the remote peer to also go through the same process.
* @desc Creates a new RTCPeerConnection object, which represents a WebRTC connection between the local device and a remote peer and adds event listeners to it
202
+
* @function createPeer - Creates a new RTCPeerConnection object, which represents a WebRTC connection between the local device and a remote peer and adds event listeners to it
* @desc The local client's remote description is set as the incoming Answer SDP to define who we are trying to connect to on the other end of the connection.
329
-
* @param {object} data SDP answer
326
+
* @function handleAnswer - The local client's remote description is set as the incoming Answer SDP to define who we are trying to connect to on the other end of the connection.
* @desc As the local client's ICE Candidates are being generated, they are being sent to the remote client to complete the connection
339
-
* @param {RTCPeerConnectionIceEvent} e
337
+
* @function handleIceCandidateEvent As the local client's ICE Candidates are being generated, they are being sent to the remote client to complete the connection
* @desc ICE Candidates being sent from each end of the connection are added to a list of potential connection methods until both ends have a way of connecting to eachother
354
-
* @param {Object} data containing a property payload with an incoming ICE Candidate
352
+
* @function handleNewIceCandidate ICE Candidates being sent from each end of the connection are added to a list of potential connection methods until both ends have a way of connecting to eachother
353
+
* @param {Object} data containing a property payload with an incoming ICE Candidate
* @desc Once the connection is made, the RTCRtpReceiver interface is exposed and this function is then able to extract the MediaStreamTrack from the sender's RTCPeerConnection.
365
-
* @param {RTCTrackEvent} e An Event Object, also contains the stream
363
+
* @function handleTrackEvent - Once the connection is made, the RTCRtpReceiver interface is exposed and this function is then able to extract the MediaStreamTrack from the sender's RTCPeerConnection.
364
+
* @param {RTCTrackEvent} e An Event Object, also contains the stream
* @desc Enables screen sharing using MediaSession.getDisplayMedia()
371
+
* @function shareScreen - Enables screen sharing using MediaSession.getDisplayMedia()
372
372
*/
373
373
functionshareScreen(): void{
374
374
//TODOS: On a new connection the local and streamed screen bugs producing: Rtconnect.jsx:273 Uncaught (in promise) DOMException: The peer connection is closed.
* @desc if any client chooses to end their call then the person who ends the call first closes their connection and resets the remote video component while also sending a message to the remote peer to also go through the same process.
393
-
* @param {boolean} isEnded
393
+
* @function endCall - if any client chooses to end their call then the person who ends the call first closes their connection and resets the remote video component while also sending a message to the remote peer to also go through the same process.
0 commit comments