Skip to content

Instantly share code, notes, and snippets.

View kwindla's full-sized avatar

Kwindla Hultman Kramer kwindla

View GitHub Profile
style {
.testClass {
background-color: red;
}
}
@kwindla
kwindla / checkForFaces()
Created November 5, 2019 03:10
Function to loop forever while in a Daily.co call, drawing bounding boxes around faces
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
@kwindla
kwindla / simple-start-camera.html
Last active October 27, 2021 07:03
Daily.co API for video chat: start camera before joining.
<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>
@kwindla
kwindla / sample-createCallObject.html
Created December 30, 2019 20:13
Daily.co API for video chat: simple "object-style" sample
<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>
@kwindla
kwindla / web-audio-merge.js
Created January 7, 2020 23:56
merge audio tracks partial sample
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
@kwindla
kwindla / ding.html
Created February 14, 2020 20:03
Daily.co video calls API configure "new participant" sound
<html>
<head>
<title>configurable sound test</title>
<script src="https://unpkg.com/@daily-co/daily-js"></script>
<style>
div {
margin-bottom: 1em;
}
#join-sound-off-div {
display: none;
@kwindla
kwindla / daily-iframe-zindex.html
Last active August 9, 2020 21:40
Daily.co video call API example - dynamically set iframe z-index value
<html>
<head>
<title>css test</title>
<script src="https://unpkg.com/@daily-co/daily-js"></script>
</head>
<body onload="main()">
<div style="width: 100%; height: 100%;
position: absolute; z-index: 50;
background-color: blue">
@kwindla
kwindla / record-local-audio.html
Created September 4, 2020 03:20
Daily.co video call API local audio track recorder example
<html>
<head>
<title>record local audio</title>
<script src="./daily-js-pluot-core/dist/daily-iframe.js"></script>
</head>
<body onload="join()">
<div id="buttons" style="width: 50%; float: left">
</div>
// accumulated "wisdom" to handle as many play()-related issues as possible, going back
// to browser versions of the distant past.
//
// currently we use separate <video> and <audio> elements as part of ensuring that play()
// works as expected for both video and sound. new browser versions *definitely do*
// change this behavior, though, so the code below will change over time, too.
// we set the elements up like this in our render() function:
<html>
<head>
<title>custom camera track</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="https://unpkg.com/@daily-co/daily-js"></script>
</head>
<body>
<div id="buttons" style="width: 50%; float: left;">
room url:
<input size="40" type="text" id="roomUrl"