From 87f5da0d3a3ed941a759cfb90b50544474bf4e97 Mon Sep 17 00:00:00 2001 From: Jeff Emmett <46964190+Jeff-Emmett@users.noreply.github.com> Date: Sun, 8 Dec 2024 19:19:19 -0500 Subject: [PATCH] fixing daily api and domain --- src/shapes/VideoChatShapeUtil.tsx | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/shapes/VideoChatShapeUtil.tsx b/src/shapes/VideoChatShapeUtil.tsx index af79ec2..13b9dbf 100644 --- a/src/shapes/VideoChatShapeUtil.tsx +++ b/src/shapes/VideoChatShapeUtil.tsx @@ -86,8 +86,8 @@ export class VideoChatShape extends BaseBoxShapeUtil { } try { - // Create room directly with Daily.co API - const response = await fetch("https://api.daily.co/v1/rooms", { + // Create room using the worker endpoint + const response = await fetch(`${WORKER_URL}/daily/rooms`, { method: "POST", headers: { "Content-Type": "application/json", @@ -97,17 +97,26 @@ export class VideoChatShape extends BaseBoxShapeUtil { name: `canvas-room-${shape.id}`, privacy: "public", properties: { - enable_recording: true, + enable_chat: true, start_audio_off: true, start_video_off: true, - enable_chat: true, + enable_screenshare: true, + enable_recording: "cloud", max_participants: 8, + enable_network_ui: true, + enable_prejoin_ui: true, + enable_people_ui: true, + enable_pip_ui: true, + enable_emoji_reactions: true, + enable_hand_raising: true, + enable_noise_cancellation_ui: true, }, }), }) if (!response.ok) { - throw new Error(`Failed to create room: ${response.statusText}`) + const error = await response.json() + throw new Error(`Failed to create room: ${JSON.stringify(error)}`) } const data = await response.json() @@ -119,7 +128,7 @@ export class VideoChatShape extends BaseBoxShapeUtil { type: "VideoChat", props: { ...shape.props, - roomUrl, + roomUrl: roomUrl, }, }) } catch (error) {