feat: enable transcription automatically (#21691)

* fest: Add enableAutomaticTranscription field to CalVideoSettings schema

* fest: Update backend logic for enableAutomaticTranscription in event types

* fest: Add frontend support for enableAutomaticTranscription in video meetings and event types

* fest: Add localization strings for enableAutomaticTranscription feature

* fix: enable transcription feature

* Update apps/web/lib/video/[uid]/getServerSideProps.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: akarsh-jain-790 <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2025-06-13 07:51:57 +00:00
1 parent 6de6f8e697
commit 8de4897042
14 files changed
+73 -3

No files matched your search

@@ -22,6 +22,7 @@ const md = new MarkdownIt("default", { html: true, breaks: true, linkify: true }
type CalVideoSettings = {
disableRecordingForGuests: boolean;
disableRecordingForOrganizer: boolean;
enableAutomaticTranscription: boolean;
};
const shouldEnableRecordButton = ({
@@ -43,6 +44,19 @@ const shouldEnableRecordButton = ({
return !calVideoSettings.disableRecordingForGuests;
};
const shouldEnableAutomaticTranscription = ({
hasTeamPlan,
calVideoSettings,
}: {
hasTeamPlan: boolean;
calVideoSettings?: CalVideoSettings | null;
}) => {
if (!hasTeamPlan) return false;
if (!calVideoSettings) return false;
return !!calVideoSettings.enableAutomaticTranscription;
};
const checkIfUserIsHost = async ({
booking,
sessionUserId,
@@ -204,6 +218,11 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
isOrganizer: sessionUserId === bookingObj.user?.id,
});
const enableAutomaticTranscription = shouldEnableAutomaticTranscription({
hasTeamPlan: !!hasTeamPlan,
calVideoSettings: bookingObj.eventType?.calVideoSettings,
});
return {
props: {
meetingUrl: videoReference.meetingUrl ?? "",
@@ -225,6 +244,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
displayLogInOverlay,
loggedInUserName: sessionUserId ? session?.user?.name : undefined,
showRecordingButton,
enableAutomaticTranscription,
rediectAttendeeToOnExit: isOrganizer
? undefined
: bookingObj.eventType?.calVideoSettings?.redirectUrlOnExit,