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
setupAudioContext () { | |
this.audioContext = new window.AudioContext(); | |
// create an output stream node. have to use the constructor form | |
// because we want to make the stream mono | |
this.audioOut = new MediaStreamAudioDestinationNode(this.audioContext, | |
{ channelCount: 1 }); | |
// connecting a single gain node to the audioOut node suffices for | |
// the pipeline to work. a MediaStreamDestination with nothing |
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
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>basic video call object demo</title> | |
<script src="https://unpkg.com/@daily-co/daily-js"></script> | |
</head> | |
<body onload="run()"> | |
<p> <button onclick="callFrame.join()">join call</button> </p> | |
<p> <button onclick="callFrame.leave()">leave call</button> </p> |
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
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>basic video call object demo</title> | |
<script crossorigin src="https://unpkg.com/@daily-co/daily-js"></script> | |
<!-- <script crossorigin src="../dist/daily-iframe.js"></script> --> | |
</head> | |
<body onload="run()"> | |
<p> <button onclick="callFrame.startCamera()">start camera</button> </p> |
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
async function checkForFaces() { | |
try { | |
if (callFrame.meetingState() !== 'joined-meeting') { | |
return; | |
} | |
// remove all bounding boxes | |
for (let el of document.getElementsByClassName('face-boxes')) { | |
el.remove(); | |
} | |
// detect faces |
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
style { | |
.testClass { | |
background-color: red; | |
} | |
} |
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
let button = document.getElementById('start-call-button'); | |
button.innerHTML = 'end call'; | |
button.onclick = () => { | |
document.body.removeChild(iframeEl); | |
iframeEl.src = null; | |
button.innerHTML = 'start call'; | |
button.onclick = startCall; | |
// window.location.origin is this page's url | |
// without the hash fragment | |
window.location = window.location.origin |
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'); |
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
<body onload="maybeJoinCall()"> | |
function maybeJoinCall() { | |
if (window.location.hash) { | |
startCall(window.location.hash.substring(1)); | |
} | |
} |
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
// 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; |
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
# create a new video call room, with a random name, | |
# that expires 60 seconds from now | |
# | |
curl -H "Content-Type: application/json" \ | |
-H "Authorization: Bearer $YOUR_API_TOKEN" \ | |
-XPOST -d \ | |
'{"properties":{"exp":'`expr $(date +%s) + 60`'}}' \ | |
https://api.daily.co/v1/rooms/ |