Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>While testing <strong>WebRTC</strong>, I found that such condition occurs when we call <code>peerConnection.addStream(…)</code> in the <strong>wrong</strong> place ---- </p> <p><em>You must remember that ordering highly matters in <strong>WebRTC</strong>!</em></p> <hr> <h3>Updated at: 6:36 PM - Thursday, July 17, 2014 (UTC)</h3> <p>Blank video occurs in following cases:</p> <ol> <li>You're using STUN whilst your SSL certificate is either expired or it has invalid entries.</li> <li>You're using STUN however it is corporate firewall, or hospital network or private network which is blocking or hiding external ip addresses or some ports.</li> <li>Both peers has invalid sendrecv/sendonly/recvonly pairs</li> <li>Offerer didn't attach the stream or it is Firefox which fails in cases when user attached only audio stream however you're using <code>OfferToReceiveVideo:true</code></li> <li>You're checking for <code>HTMLMediaElement.HAVE_CURRENT_DATA</code> or <code>mediaElement.paused</code> or <code>mediaElement.currentTime</code> whilst it is android which has known issues regarding these properties.</li> </ol> <h2>Solutions?</h2> <ol> <li>Use TURN from XirSys or <a href="https://code.google.com/p/rfc5766-turn-server/" rel="noreferrer">install your own</a>.</li> <li>Make sure that you're using valid SSL certificate or use HTTP instead.</li> <li>Make sure that offerer attached the stream; also make sure that <code>OfferToReceiveAudio</code>/<code>OfferToReceiveVideo</code> are used according to stream(s) attached.</li> <li>Make sure that you didn't modify the SDP; also try to compare SDP between both peers and find-out mismatches.</li> </ol> <p>Ordering of the code is, kind of rare-issues, nowadays, because we all know that <code>addStream</code> should be called before creating offer or answer; even for renegotiated sessions.</p> <p>Try to use <code>chrome://webrtc-internals</code> and Firefox's <code>about:config</code> to see what's happening inside these browsers; and always use console-logs for <code>onIceConnectionStateChange</code> event which helps you check if ICE-Agent <code>failed</code> in the ICE-connectivity check process or...</p> <p>Sometimes setting-remote-sdp for offerer too earlier, causes exceptions. Always use <code>onSdpError</code> both for <code>createOffer</code>/<code>createAnswer</code> and <code>setLocalDescription</code>/<code>setRemoteDescription</code> e.g.</p> <p><code>peer.setRemoteDescription(remoteSDP, onSdpSuccess, onSdpFailure); </code></p> <hr> <p>A few demos resources:</p> <ol> <li><a href="https://github.com/muaz-khan/WebRTC-Experiment" rel="noreferrer">https://github.com/muaz-khan/WebRTC-Experiment</a> / <a href="https://www.webrtc-experiment.com/" rel="noreferrer">Demos</a></li> <li><a href="https://github.com/mozilla/webrtc-landing" rel="noreferrer">https://github.com/mozilla/webrtc-landing</a></li> </ol> <p>and <a href="https://www.webrtc-experiment.com/docs/TURN-server-installation-guide.html" rel="noreferrer">https://www.webrtc-experiment.com/docs/TURN-server-installation-guide.html</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload