Scheduling infrastructure for absolutely everyone.
Removing room entry buffer before a Daily.co video call (#1902)
Lola08e6059c8d97
diff --git a/README.md b/README.mdindex 24fe118ce21..c4600e9f149 100644--- a/README.md+++ b/README.md@@ -334,6 +334,7 @@ Contributions are what make the open source community such an amazing place to b2. From within your dashboard, go to the [developers](https://dashboard.daily.co/developers) tab.3. Copy your API key.4. Now paste the API key to your .env file into the `DAILY_API_KEY` field in your .env file.+5. If you have the [Daily Scale Plan](https://www.daily.co/pricing) set the `DAILY_SCALE_PLAN` variable to `true` in order to use features like video recording.<!-- LICENSE -->diff --git a/apps/web/lib/integrations/Daily/DailyVideoApiAdapter.ts b/apps/web/lib/integrations/Daily/DailyVideoApiAdapter.tsindex 5d3d408b05f..03e340552bc 100644--- a/apps/web/lib/integrations/Daily/DailyVideoApiAdapter.ts+++ b/apps/web/lib/integrations/Daily/DailyVideoApiAdapter.ts@@ -102,9 +102,8 @@ const DailyVideoApiAdapter = (credential: Credential): VideoApiAdapter => {const translateEvent = (event: CalendarEvent) => {// Documentation at: https://docs.daily.co/reference#list-rooms- // added a 1 hour buffer for room expiration and room entry+ // added a 1 hour buffer for room expirationconst exp = Math.round(new Date(event.endTime).getTime() / 1000) + 60 * 60;- const nbf = Math.round(new Date(event.startTime).getTime() / 1000) - 60 * 60;const scalePlan = process.env.DAILY_SCALE_PLAN;if (scalePlan === "true") {@@ -117,7 +116,6 @@ const DailyVideoApiAdapter = (credential: Credential): VideoApiAdapter => {enable_screenshare: true,enable_chat: true,exp: exp,- nbf: nbf,enable_recording: "local",},};@@ -131,7 +129,6 @@ const DailyVideoApiAdapter = (credential: Credential): VideoApiAdapter => {enable_screenshare: true,enable_chat: true,exp: exp,- nbf: nbf,},};};diff --git a/apps/web/pages/video/[uid].tsx b/apps/web/pages/video/[uid].tsxindex 2c7319ebd7c..488dc0d4409 100644--- a/apps/web/pages/video/[uid].tsx+++ b/apps/web/pages/video/[uid].tsx@@ -20,27 +20,19 @@ export default function JoinCall(props: JoinCallPageProps) {//if no booking redirectis to the 404 pageconst emptyBooking = props.booking === null;- //daily.co calls have a 60 minute exit and entry buffer when a user enters a call when it's not available it will trigger the modals+ //daily.co calls have a 60 minute exit buffer when a user enters a call when it's not available it will trigger the modalsconst now = new Date();- const enterDate = new Date(now.getTime() + 60 * 60 * 1000);const exitDate = new Date(now.getTime() - 60 * 60 * 1000);- console.log(enterDate);-- //find out if the meeting is upcoming or in the past+ //find out if the meeting is in the pastconst isPast = new Date(props.booking?.endTime || "") <= exitDate;- const isUpcoming = new Date(props.booking?.startTime || "") >= enterDate;- const meetingUnavailable = isUpcoming == true || isPast == true;+ const meetingUnavailable = isPast == true;useEffect(() => {if (emptyBooking) {router.push("/video/no-meeting-found");}- if (isUpcoming) {- router.push(`/video/meeting-not-started/${props.booking?.uid}`);- }-if (isPast) {router.push(`/video/meeting-ended/${props.booking?.uid}`);}@@ -126,7 +118,7 @@ export default function JoinCall(props: JoinCallPageProps) {<div style={{ zIndex: 2, position: "relative" }}><Link href="/"><img- className="fixed z-10 hidden h-5 w-auto sm:inline-block"+ className="h-5·w-auto fixed z-10 hidden sm:inline-block"src="https://cal.com/logo-white.svg"alt="Cal.com Logo"style={{