Skip to content

Commit 8fa272d

Browse files
get offer fix
1 parent 0afe133 commit 8fa272d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/client/components/main/WebRTC-composer/WebRTCServerEntryForm.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ const WebRTCServerEntryForm: React.FC<Props> = () => {
163163
style={{ margin: '10px' }}
164164
onClick={() => {
165165
console.log('newRequestWebRTCfromOclick:', newRequestWebRTC);
166+
if (!newRequestWebRTC.webRTCpeerConnection) {
167+
console.warn(
168+
'webRTCpeerConnection is NULL! createPeerConnection may not have run.'
169+
);
170+
}
166171
webrtcPeerController.createOffer(newRequestWebRTC);
167172
}}
168173
>

src/client/controllers/webrtcPeerController.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ const webrtcPeerController = {
9393
newRequestWebRTCSet({
9494
// new state object is created to update redux state
9595
...newRequestWebRTC, //copy properties from existing state object
96+
webRTCpeerConnection: peerConnection,
97+
webRTCLocalStream: localStream,
9698
webRTCRemoteStream: remoteStream, //remote stream overwritten
9799
})
98100
);
@@ -176,6 +178,12 @@ const webrtcPeerController = {
176178
// what in create offer triggers the ice candidate to be sent?
177179
createOffer: async (newRequestWebRTC: RequestWebRTC): Promise<void> => {
178180
//grab the peer connection off the state to manipulate further
181+
console.log('checking peer connection inside createOffer');
182+
console.log(
183+
'webRTCpeerConnection exists:',
184+
!!newRequestWebRTC.webRTCpeerConnection
185+
);
186+
179187
let { webRTCpeerConnection } = newRequestWebRTC;
180188
if (!webRTCpeerConnection) return;
181189
console.log('webRTCPeerConnect:', webRTCpeerConnection);

0 commit comments

Comments
 (0)