Skip to content

Instantly share code, notes, and snippets.

@kwindla
Created February 1, 2021 04:50
Show Gist options
  • Save kwindla/3796c84ea1d4233786bf29163b503409 to your computer and use it in GitHub Desktop.
Save kwindla/3796c84ea1d4233786bf29163b503409 to your computer and use it in GitHub Desktop.
Daily video API: reduced resolution camera settings for lower cpu usage
<html>
<head>
<title>reduced cpu camera setting</title>
<script src="https://unpkg.com/@daily-co/daily-js"></script>
</head>
<body onload="main()">
<script>
// change ROOM_URL to a room in your Daily domain
const ROOM_URL = "https:// A ROOM URL";
async function main() {
window.call = DailyIframe.createFrame({
dailyConfig: {
experimentalChromeVideoMuteLightOff: true,
camSimulcastEncodings: [
{ maxBitrate: 100000, maxFramerate: 5, scaleResolutionDownBy: 2 },
{ maxBitrate: 600000 },
],
},
});
call.on("error", (e) => console.error(e));
await call.join({ url: ROOM_URL });
call.setBandwidth({
trackConstraints: { width: 640, height: 360, maxFramerate: 20 },
});
}
function toggleLocalVideo() {
call.setShowLocalVideo(!call.showLocalVideo());
}
function toggleParticipantsBar() {
call.setShowParticipantsBar(!call.showParticipantsBar());
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment