title: How do I indicate the end of remote candidates?
body: <p>For an WebRTC application, I want to signal, that there are no more remote candidates while using Trickle ICE. The <a href="https://www.w3.org/TR/webrtc/" rel="noreferrer">W3C WebRTC spec says</a>:</p>
  
  <blockquote>
    <p>This method can also be used to indicate the end of remote candidates when called with an empty string for the candidate member</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>This can be indicated by calling addIceCandidate with a candidate value whose candidate property is set to an empty string</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>If candidate.candidate is an empty string, process candidate as an end-of-candidates indication</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>If this RTCIceCandidate represents an end-of-candidates indication, candidate is an empty string.</p>
  </blockquote>
  
  <p>Thus, I tried different methods in Chrome 67, but non of them works:</p>
  
  <pre><code>pc.addIceCandidate('');
  </code></pre>
  
  <blockquote>
    <p>TypeError: Failed to execute 'addIceCandidate' on 'RTCPeerConnection': The provided value is not of type '(RTCIceCandidateInit or RTCIceCandidate)'</p>
  </blockquote>
  
  <pre><code>pc.addIceCandidate({candidate:''});
  </code></pre>
  
  <blockquote>
    <p>TypeError: Candidate missing values for both sdpMid and sdpMLineIndex</p>
  </blockquote>
  
  <pre><code>pc.addIceCandidate(new IceCandidate());
  </code></pre>
  
  <blockquote>
    <p>Failed to construct 'RTCIceCandidate': 1 argument required, but only 0 present.</p>
  </blockquote>
  
  <pre><code>pc.addIceCandidate(new IceCandidate(''));
  </code></pre>
  
  <blockquote>
    <p>Failed to construct 'RTCIceCandidate': parameter 1 ('candidateInitDict') is not an object.</p>
  </blockquote>
  
  <pre><code>pc.addIceCandidate(new IceCandidate({}));
  </code></pre>
  
  <blockquote>
    <p>DOMException: Failed to construct 'RTCIceCandidate': The 'candidate' property is not a string, or is empty.</p>
  </blockquote>
  
  <pre><code>pc.addIceCandidate(new IceCandidate({candidate:''}));
  </code></pre>
  
  <blockquote>
    <p>DOMException: Failed to construct 'RTCIceCandidate': The 'candidate' property is not a string, or is empty.</p>
  </blockquote>
  
  <p>Question: How do I indicate the end of remote candidates?</p>
  
  <p>[EDIT]:</p>
  
  <p>In 2016/2017, it was just <code>null</code>:</p>
  
  <ul>
  <li><a href="https://github.com/w3c/webrtc-pc/pull/527/" rel="noreferrer">https://github.com/w3c/webrtc-pc/pull/527/</a></li>
  <li><a href="https://webrtcstandards.info/webrtc-trickle-ice/" rel="noreferrer">https://webrtcstandards.info/webrtc-trickle-ice/</a></li>
  <li><a href="http://lists.w3.org/Archives/Public/public-webrtc/2017Mar/0054.html" rel="noreferrer">http://lists.w3.org/Archives/Public/public-webrtc/2017Mar/0054.html</a></li>
  <li><a href="https://github.com/w3c/webrtc-pc/issues/1077" rel="noreferrer">https://github.com/w3c/webrtc-pc/issues/1077</a></li>
  </ul>
  
  <blockquote>
    <p>The working group decided to keep this special "all gathering is done" null candidate for backwards compatibility"</p>
  </blockquote>
  
  <p>It seems, that it does not work anymore:</p>
  
  <pre><code>pc.addIceCandidate(null);
  </code></pre>
  
  <blockquote>
    <p>TypeError: Candidate missing values for both sdpMid and sdpMLineIndex</p>
  </blockquote>
  
  <pre><code>pc.addIceCandidate({candidate: null});
  </code></pre>
  
  <blockquote>
    <p>TypeError: Candidate missing values for both sdpMid and sdpMLineIndex</p>
  </blockquote>