@videosdk.live/react-sdk 0.4.1 → 0.4.3

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.
@@ -37,13 +37,13 @@ export class ConnectionMeeting {
37
37
  * @param eventType
38
38
  * @param listener Callback function
39
39
  */
40
- on(eventType: 'participant-joined' | 'participant-left' | 'chat-message', listener: (data: any) => void): void;
40
+ on(eventType: 'participant-joined' | 'participant-left' | 'data', listener: (data: any) => void): void;
41
41
  /**
42
42
  * @deprecated
43
43
  * Remove event listener
44
44
  * @param eventType
45
45
  * @param listener Callback function
46
46
  */
47
- off(eventType: 'participant-joined' | 'participant-left' | 'chat-message', listener: (data: any) => void): void;
47
+ off(eventType: 'participant-joined' | 'participant-left' | 'data', listener: (data: any) => void): void;
48
48
  }
49
49
  import { ConnectionParticipant } from './connectionParticipant';
@@ -189,7 +189,7 @@ export function MeetingConsumer({
189
189
  onResumedAllStreams,
190
190
  onRecordingStarted,
191
191
  onRecordingStopped,
192
- onChatMessage,
192
+ onData,
193
193
  onMeetingJoined,
194
194
  onMeetingLeft,
195
195
  onLiveStreamStarted,
@@ -239,12 +239,11 @@ export function MeetingConsumer({
239
239
  onResumedAllStreams?: ({ kind }: { kind: "audio" | "video" | "share" | "shareAudio" | "all" | undefined }) => void;
240
240
  onRecordingStarted?: () => void;
241
241
  onRecordingStopped?: () => void;
242
- onChatMessage?: (data: {
243
- message: string;
244
- senderId: string;
242
+ onData?: (data: {
243
+ from: string;
245
244
  timestamp: string;
246
- senderName: string;
247
- payload: object;
245
+ payload: string | Uint8Array;
246
+ reliability: string;
248
247
  }) => void;
249
248
  onMeetingJoined?: () => void;
250
249
  onMeetingLeft?: () => void;
@@ -692,7 +691,7 @@ export function useMeeting({
692
691
  onResumedAllStreams,
693
692
  onRecordingStarted,
694
693
  onRecordingStopped,
695
- onChatMessage,
694
+ onData,
696
695
  onMeetingJoined,
697
696
  onMeetingLeft,
698
697
  onLiveStreamStarted,
@@ -748,12 +747,11 @@ export function useMeeting({
748
747
  onResumedAllStreams?: ({ kind }: { kind: "audio" | "video" | "share" | "shareAudio" | "all" | undefined }) => void;
749
748
  onRecordingStarted?: () => void;
750
749
  onRecordingStopped?: () => void;
751
- onChatMessage?: (data: {
752
- message: string;
753
- senderId: string;
750
+ onData?: (data: {
751
+ from: string;
754
752
  timestamp: string;
755
- senderName: string;
756
- payload: object;
753
+ payload: string | Uint8Array;
754
+ reliability: string;
757
755
  }) => void;
758
756
  onMeetingJoined?: () => void;
759
757
  onMeetingLeft?: () => void;
@@ -937,6 +935,10 @@ export function useMeeting({
937
935
  muteMic: () => void;
938
936
  toggleMic: (customAudioTrack?: MediaStream | undefined) => void;
939
937
  enableWebcam: (customVideoTrack?: MediaStream | undefined) => void;
938
+ send: (payload: string | Blob | ArrayBuffer | ArrayBufferView,
939
+ options?: {
940
+ reliability?: "RELIABLE" | "UNRELIABLE";
941
+ }) => Promise<boolean>;
940
942
  disableWebcam: () => void;
941
943
  toggleWebcam: (customVideoTrack?: MediaStream | undefined) => void;
942
944
  enableScreenShare: (customScreenShareTrack?: MediaStream | undefined) => void;
@@ -1589,6 +1591,7 @@ export function createScreenShareVideoTrack({
1589
1591
  }): Promise<MediaStream>;
1590
1592
 
1591
1593
  /**
1594
+ * @deprecated
1592
1595
  * @param timeoutDuration - This will accept the timeoutDuration.
1593
1596
  *
1594
1597
  * **Code Example**
@@ -72,15 +72,13 @@ export class Meeting {
72
72
  | 'TRANSCRIPTION_STOPPING';
73
73
 
74
74
  /**
75
- * @description These object will contain all the messages send using the `sendChatMessage` method
75
+ * @description These object will contain all the messages send using the `send` method
76
76
  */
77
77
  messages: Array<{
78
- message: string;
79
- senderId: string;
80
- senderName: string;
81
- timestamp: Date;
82
- topic: string;
83
- payload: object;
78
+ from: string;
79
+ timestamp: string;
80
+ payload: string | Uint8Array;
81
+ reliability: string;
84
82
  }>;
85
83
 
86
84
  /**
@@ -150,10 +148,19 @@ export class Meeting {
150
148
  enableScreenShare(customScreenSharingTrack?: MediaStream): void;
151
149
 
152
150
  /**
153
- * @deprecated
154
- * @param text Message which is to be send to all participants in th meeting
155
- */
156
- sendChatMessage(text: string): void;
151
+ * Send a message over the DataChannel with chunking.
152
+ *
153
+ * @param {string | Blob | ArrayBuffer | ArrayBufferView} payload - The message to send.
154
+ * @param {object} [options={}] - Additional send options.
155
+ * @param {"RELIABLE" | "UNRELIABLE"} [options.reliability="RELIABLE"] - Reliability mode.
156
+ * @returns {Promise<boolean>} Resolves `true` if the message was sent, rejects if an error occurred.
157
+ */
158
+ send(
159
+ payload: string | Blob | ArrayBuffer | ArrayBufferView,
160
+ options?: {
161
+ reliability?: "RELIABLE" | "UNRELIABLE";
162
+ }
163
+ ): Promise<boolean>;
157
164
 
158
165
  /**
159
166
  * @param kind
@@ -522,7 +529,7 @@ export class Meeting {
522
529
  | 'meeting-state-changed'
523
530
  | 'switch-meeting'
524
531
  | 'error'
525
- | 'chat-message'
532
+ | 'data'
526
533
  | 'transcription-text'
527
534
  | 'transcription-state-changed'
528
535
  | 'character-joined'
@@ -576,7 +583,7 @@ export class Meeting {
576
583
  | 'meeting-state-changed'
577
584
  | 'switch-meeting'
578
585
  | 'error'
579
- | 'chat-message'
586
+ | 'data'
580
587
  | 'transcription-text'
581
588
  | 'transcription-state-changed'
582
589
  | 'character-joined'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@videosdk.live/react-sdk",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.modern.js",
@@ -74,7 +74,7 @@
74
74
  }
75
75
  },
76
76
  "dependencies": {
77
- "@videosdk.live/js-sdk": "^0.3.1",
77
+ "@videosdk.live/js-sdk": "0.3.6",
78
78
  "events": "^3.3.0"
79
79
  }
80
80
  }