title: Error in executing 'send' on 'RTCDataChannel' simple-peer
body: <p>I am trying out webrtc using the library, simple-peer.
  I am following this tutorial linked <a href="https://www.youtube.com/watch?v=ieBtXwHvoNk" rel="nofollow noreferrer">here</a> on opera browser.
  I am facing this error when sending a small string of 'hello':</p>
  
  <pre><code>Uncaught DOMException: Failed to execute 'send' on 'RTCDataChannel': RTCDataChannel.readyState is not 'open' at Peer.send (http://127.0.0.1:9966/bundle.js:7011:19) at HTMLButtonElement.&lt;anonymous&gt; (http://127.0.0.1:9966/bundle.js:22:14) send @ index.js:241 (anonymous) @ index.js:21
  </code></pre>
  
  <p>Here is my index.js:</p>
  
  <pre class="lang-js prettyprint-override"><code>
      var Peer = require('simple-peer')
  
      if (Peer.WEBRTC_SUPPORT) {
          console.log("Support");
          peer = new Peer({
              initiator: location.hash === '#1',
              trickle:true
          })
          peer.on('signal', function (data) {
              document.getElementById('yourId').value = JSON.stringify(data)
          })
          document.getElementById("connect").addEventListener('click', function () {
              var otherId = JSON.parse(document.getElementById('otherId').value)
              peer.signal(otherId)
          })
          peer.on('connect', function () {
              console.log("CONNECTED");
          })
          document.getElementById("send").addEventListener('click', function () {
              var message = document.getElementById("message_to_send").value
              peer.write(message)
          })
          peer.on("data", function (data) {
              console.log(data)
              document.getElementById("messages").textContent += data + "\n"
          })
  
      } else {
          console.log("No Support, Sorry");
      }
  
  </code></pre>
  
  <p>Changing 
  <code>peer.send(data)</code>
  to 
  <code>peer.write(data)</code>
  does to give any error, but nor does it send the data to the other browser</p>
  
  <p>What am I doing wrong?
  Thanks in advance</p>