getUserMedia problem in firefox
[henge/kiak.git] / client.js
index 2aa4950..f38f3ab 100644 (file)
--- a/client.js
+++ b/client.js
@@ -1,8 +1,6 @@
 const body = document.createElement('body')
 const root = document.createElement('div')
 document.title = "Strapp.io Client"
-body.appendChild(root)
-document.body = body
 const conf = {"iceServers": [{ "urls": "stun:stun.1.google.com:19302" }] }
 let dataChannel
 
@@ -179,10 +177,17 @@ getPublicKey().then((cpk) => {
   /* Start data channel */
   dataChannel = cpc.createDataChannel("sendChannel");
   dataChannel.onmessage = (msg) => {
-    console.log(msg.data)
+    /* Get mediaStream from host and add it to the video */
+    let video = document.querySelector('')
   }
   dataChannel.onopen = () => {
     dataChannel.send(`Hi from the Client`)
+    document.write('<button> Connection with host established! </button> <video autoplay id="screenOutput"></video>')
   }
 
 })
+document.addEventListener('DOMContentLoaded', () => {
+
+    document.body.innerHTML = `<button> Setting up connection with host </button>`
+
+});