title: Remote webcam stream using webkitPeerConnection00 isn't displayed
body: <p>I am trying out the sample code for peer-to-peer webcam communication in <a href="http://www.html5rocks.com/en/tutorials/webrtc/basics/" rel="nofollow">http://www.html5rocks.com/en/tutorials/webrtc/basics/</a> where both clients are implemented in the same page. </p>
  
  <p>The 'local' webcam stream is displayed correctly. However, nothing shows up on the 'remote' stream and I'm not sure why.</p>
  
  <p>Below is my code. I am currently testing it out on a hosted server. Thanks!</p>
  
  <pre><code>var localStream;
  
  navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia ||
      navigator.mozGetUserMedia || navigator.msGetUserMedia;
  
  window.URL = window.URL || window.webkitURL;
  
  navigator.getUserMedia({'audio':true, 'video':true}, onMediaSuccess, onMediaFail);
  
  function onMediaSuccess(stream) {
      var localVideo = document.getElementById("localVideo");
      var url = window.URL.createObjectURL(stream);
      localVideo.autoplay = true;
      localVideo.src = url;
      localStream = stream;
      console.log('Local stream established: ' + url);
  }
  
  function onMediaFail() {
      alert('Could not connect stream');
  }
  
  function iceCallback1(){}
  function iceCallback2(){}
  
  function gotRemoteStream(e) {
      var remoteVideo = document.getElementById("remoteVideo");
      var stream = e.stream;
      var url = window.URL.createObjectURL(stream);
      remoteVideo.autoplay = true;
      remoteVideo.src = url;
      console.log('Remote stream received: ' + url);
  }   
  
  function call(){
  
      pc1 = new webkitPeerConnection00(null, iceCallback1);   // create the 'sending' PeerConnection
      pc2 = new webkitPeerConnection00(null, iceCallback2);   // create the 'receiving' PeerConnection
  
      pc2.onaddstream = gotRemoteStream;                      // set the callback for the receiving PeerConnection to display video
  
      console.log("Adding local stream to pc1");
      pc1.addStream(localStream);                             // add the local stream for the sending PeerConnection
  
      console.log("Creating offer");
      var offer = pc1.createOffer({audio:true, video:true});  // create an offer, with the local stream
  
      console.log("Setting local description for pc1");
      pc1.setLocalDescription(pc1.SDP_OFFER, offer);          // set the offer for the sending and receiving PeerConnection
  
      console.log("Start pc1 ICE");
      pc1.startIce();
  
      console.log("Setting remote description for pc2");
      pc2.setRemoteDescription(pc2.SDP_OFFER, offer);
  
      // gotRemoteStream Triggers here
  
      console.log("Creating answer");                         // create an answer
      var answer = pc2.createAnswer(offer.toSdp(), {has_audio:true, has_video:true});
  
      console.log("Setting local description for pc2");   
      pc2.setLocalDescription(pc2.SDP_ANSWER, answer);        // set it on the sending and receiving PeerConnection 
  
      console.log("Setting remote description for pc1");
      pc1.setRemoteDescription(pc1.SDP_ANSWER, answer);
  
      console.log("Start pc2 ICE");
      pc2.startIce();                                         // start the connection process
  
      console.log("script done");
  }
  </code></pre>