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
/* 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>`
+
+});