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

+19 -1
View File
@@ -70,7 +70,13 @@ export interface DailyCustomTrayButton {
tooltip: string;
visualState?: DailyCustomTrayButtonVisualState;
}
export const CalAiTranscribe = ({ showRecordingButton }: { showRecordingButton: boolean }) => {
export const CalAiTranscribe = ({
showRecordingButton,
enableAutomaticTranscription,
}: {
showRecordingButton: boolean;
enableAutomaticTranscription: boolean;
}) => {
const daily = useDaily();
const { t } = useLocale();
@@ -107,6 +113,18 @@ export const CalAiTranscribe = ({ showRecordingButton }: { showRecordingButton:
}, [])
);
useDailyEvent("joined-meeting", (ev) => {
if (enableAutomaticTranscription) {
daily?.startTranscription();
updateCustomTrayButtons({
recording: BUTTONS.START_RECORDING,
transcription: transcription?.isTranscribing
? BUTTONS.STOP_TRANSCRIPTION
: BUTTONS.START_TRANSCRIPTION,
});
}
});
useDailyEvent("transcription-started", (ev) => {
updateCustomTrayButtons({
recording: recording?.isRecording ? BUTTONS.STOP_RECORDING : BUTTONS.START_RECORDING,
@@ -36,6 +36,7 @@ export default function JoinCall(props: PageProps) {
loggedInUserName,
overrideName,
showRecordingButton,
enableAutomaticTranscription,
rediectAttendeeToOnExit,
} = props;
const [daily, setDaily] = useState<DailyCall | null>(null);
@@ -96,7 +97,6 @@ export default function JoinCall(props: PageProps) {
callFrame = DailyIframe.getCallInstance();
} finally {
setDaily(callFrame ?? null);
callFrame?.join();
}
@@ -111,7 +111,10 @@ export default function JoinCall(props: PageProps) {
<div
className="mx-auto hidden sm:block"
style={{ zIndex: 2, left: "30%", position: "absolute", bottom: 100, width: "auto" }}>
<CalAiTranscribe showRecordingButton={showRecordingButton} />
<CalAiTranscribe
showRecordingButton={showRecordingButton}
enableAutomaticTranscription={enableAutomaticTranscription}
/>
</div>
<div style={{ zIndex: 2, position: "relative" }}>
{calVideoLogo ? (