@videosdk.live/react-sdk 0.1.88 → 0.1.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -790,6 +790,7 @@ export function useMeeting({
790
790
  playbackHlsUrl: string;
791
791
  livestreamUrl: string;
792
792
  };
793
+ transcriptionState: string;
793
794
  selectedCameraDevice?: {
794
795
  deviceId: string;
795
796
  groupId: string;
@@ -987,6 +988,73 @@ export function useFile(): {
987
988
  }) => Promise<string | null>;
988
989
  };
989
990
 
991
+ /**
992
+ * @param onTranscriptionStateChanged - This will triggered when a realtime transcription state is changed.
993
+ * ---
994
+ * @param onTranscriptionText - This will triggered when a realtime transcription text is published.
995
+ * ---
996
+ * @returns This will return `startTranscription()` and `stopTranscription()` method. You can refer this [API Reference](https://docs.videosdk.live/react/api/sdk-reference/use-transcription#returns)
997
+ * ---
998
+ * **useTranscription example**
999
+ * ```js
1000
+ *
1001
+ * function onTranscriptionStateChanged(data) {
1002
+ * console.log('New State Payload:', data)
1003
+ * }
1004
+ *
1005
+ * function onTranscriptionText(data) {
1006
+ * console.log('Transcription Text Payload:', data);
1007
+ * }
1008
+ *
1009
+ * const { startTranscription, stopTranscription } = useTranscription(topic, {
1010
+ * onTranscriptionStateChanged,
1011
+ * onTranscriptionText,
1012
+ * });
1013
+ *
1014
+ * async function startTranscription()=>{
1015
+ * await startTranscription()
1016
+ * }
1017
+ *
1018
+ * async function stopTranscription()=>{
1019
+ * await stopTranscription()
1020
+ * }
1021
+ * ```
1022
+ */
1023
+ export function useTranscription({
1024
+ onTranscriptionStateChanged,
1025
+ onTranscriptionText
1026
+ }?: {
1027
+ onTranscriptionStateChanged?: (data: { id: string; status: string }) => void;
1028
+ onTranscriptionText?: (data: {
1029
+ participantId: string;
1030
+ participantName: string;
1031
+ text: string;
1032
+ timestamp: string;
1033
+ type: 'realtime';
1034
+ }) => void;
1035
+ }): {
1036
+ /**
1037
+ * @description This method is used to start the meeting transcription
1038
+ * @param config.webhookUrl? Webhook URL which will be called by VideoSDK when the transcription state gets changed
1039
+ * @param config.modelConfig? modelConfig if any, which will be used while doing transcription
1040
+ * @param config.summary.enabled Enables or disables summary generation from realtime transcriptions.
1041
+ * @param config.summary.prompt Guides summary generation (optional).
1042
+ */
1043
+ startTranscription: ({
1044
+ webhookUrl,
1045
+ modelConfig,
1046
+ summary
1047
+ }: {
1048
+ webhookUrl?: string;
1049
+ modelConfig?: object;
1050
+ summary?: {
1051
+ enabled: boolean;
1052
+ prompt?: string;
1053
+ };
1054
+ }) => void;
1055
+ stopTranscription: () => void;
1056
+ };
1057
+
990
1058
  /**
991
1059
  * @param microphoneId - It will be the id of the mic from which the audio should be captured.
992
1060
  * ---
@@ -1193,9 +1261,12 @@ export const Constants: {
1193
1261
  INVALID_LIVESTREAM_CONFIG: number;
1194
1262
  START_HLS_FAILED: number;
1195
1263
  STOP_HLS_FAILED: number;
1264
+ START_TRANSCRIPTION_FAILED: number;
1265
+ STOP_TRANSCRIPTION_FAILED: number;
1196
1266
  RECORDING_FAILED: number;
1197
1267
  LIVESTREAM_FAILED: number;
1198
1268
  HLS_FAILED: number;
1269
+ TRANSCRIPTION_FAILED: number;
1199
1270
  ERROR_GET_VIDEO_MEDIA: number;
1200
1271
  ERROR_GET_AUDIO_MEDIA: number;
1201
1272
  ERROR_GET_DISPLAY_MEDIA: number;
@@ -1241,6 +1312,12 @@ export const Constants: {
1241
1312
  HLS_STOPPING: string;
1242
1313
  HLS_STOPPED: string;
1243
1314
  };
1315
+ transcriptionEvents: {
1316
+ TRANSCRIPTION_STARTING: string;
1317
+ TRANSCRIPTION_STARTED: string;
1318
+ TRANSCRIPTION_STOPPING: string;
1319
+ TRANSCRIPTION_STOPPED: string;
1320
+ };
1244
1321
  modes: {
1245
1322
  CONFERENCE: string;
1246
1323
  VIEWER: string;