Skip to content

Instantly share code, notes, and snippets.

@kwindla
Created March 10, 2019 21:54
Show Gist options
  • Save kwindla/5fb9dd5038f2b103ed9208424d420ae1 to your computer and use it in GitHub Desktop.
Save kwindla/5fb9dd5038f2b103ed9208424d420ae1 to your computer and use it in GitHub Desktop.
create a new room and join it
// you can replace this with your own repl.it endpoint URL!
const createRoomEndpoint = 'https://create-a-room--kwindla.repl.co'
async function startCall() {
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment