-
Notifications
You must be signed in to change notification settings - Fork 0
/
call-clients.ts
29 lines (27 loc) · 954 Bytes
/
call-clients.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import Daily from "@daily-co/daily-js";
export function setupLiveCallClient() {
const call = Daily.createCallObject({
url: "https://<your-domain-here>.daily.co/<your-room-name-here>",
});
// Place on the window for ease of development/inspection/debugging
// Not recommended in production.
//@ts-ignore
window.call = call;
return call;
}
export function setupPreviewCallClient() {
const previewer = Daily.createCallObject({
startAudioOff: true,
startVideoOff: true,
dailyConfig: { alwaysIncludeMicInPermissionPrompt: false },
strictMode: false, // allow multiple call clients
});
// Place on the window for ease of development/inspection/debugging
// Not recommended in production.
//@ts-ignore
window.previewer = previewer;
// This doesn't actually turn on the camera, since startVideoOff was set.
// It just initializes the previewer. Yeah, I know :/
previewer.startCamera();
return previewer;
}