googlecodelabs / webrtc-web

Realtime communication with WebRTC
https://codelabs.developers.google.com/codelabs/webrtc-web/
Apache License 2.0
755 stars 351 forks source link

error #120

Open Aakshara opened 4 years ago

Aakshara commented 4 years ago

I cannot see any video in step 6. Everything worked well but step 6 is the problem where I'm stuck now. There is slight error in index.html ,

, the / before js is missing. I have corrected it too, but still i cannot see the video.
Aakshara commented 4 years ago

The issue has been solved by doing nothing. But now i could see the send button and the snap &send button are disable.

devworkerkim commented 4 years ago

@Aakshara - I ran into the same problem here. Don't know if the symptoms are the same, but my console was outputting the following error:

Uncaught TypeError: Failed to construct 'RTCIceCandidate': sdpMid and sdpMLineIndex are both null.

The problem was some missing code in the main.js file that handles the 'candidate' type messages from the client. @lukemcso made a great post with his solution on issue #102.

} else if (message.type === 'candidate') {
    peerConn.addIceCandidate(new RTCIceCandidate({
      sdpMLineIndex: message.label,
      sdpMid: message.id,
      candidate: message.candidate
    }));

Be sure to do a hard refresh in your browser (Chrome shortcut Ctrl+F5) so the changes are taken.

You can also compare the code from the previous step and notice the sdpMLineIndex line is missing in the step-06 main.js file.