Created
March 10, 2019 21:59
-
-
Save kwindla/007eecb5ff8ac1d761974b2cb93552f3 to your computer and use it in GitHub Desktop.
modified startCall() - create a new room only if we aren't passed a callUrl argument
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createRoomEndpoint = 'https://create-a-room--kwindla.repl.co'; | |
async function startCall(callUrl) { | |
if (!callUrl) { | |
let response = await fetch(createRoomEndpoint), | |
roomData = await response.json(); | |
callUrl = roomData.url; | |
} | |
let iframeEl = document.createElement('iframe'); | |
iframeEl.width = 350; | |
iframeEl.height = 425; | |
iframeEl.style.position = 'absolute'; | |
iframeEl.style.right = '1em'; | |
iframeEl.style.bottom = '3em'; | |
iframeEl.src = callUrl; | |
iframeEl.allow="camera; microphone; autoplay"; | |
document.body.appendChild(iframeEl); | |
window.location = '#' + callUrl | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment