Skip to content

Instantly share code, notes, and snippets.

@kwindla
Created March 10, 2019 21:49
Show Gist options
  • Save kwindla/4a034be60cb13845d79eb4b9ba2de63e to your computer and use it in GitHub Desktop.
Save kwindla/4a034be60cb13845d79eb4b9ba2de63e to your computer and use it in GitHub Desktop.
a button that starts a new video call
<button onclick="startCall()">
start call
</button>
<script>
async function startCall() {
let callUrl = 'https://api-demo.daily.co/this-is-a-placeholder',
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);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment