@videosdk.live/react-sdk 0.1.88 → 0.1.89
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.
- package/dist/index.js +57 -6
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +57 -7
- package/dist/index.modern.js.map +1 -1
- package/dist/types/index.d.ts +65 -0
- package/dist/types/meeting.d.ts +458 -435
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -35,7 +35,9 @@ var events = {
|
|
|
35
35
|
'recording-state-changed': eventPrifix + "-recording-state-changed",
|
|
36
36
|
'livestream-state-changed': eventPrifix + "-livestream-state-changed",
|
|
37
37
|
'meeting-state-changed': eventPrifix + "-meeting-state-changed",
|
|
38
|
-
'participant-mode-changed': eventPrifix + "-participant-mode-changed"
|
|
38
|
+
'participant-mode-changed': eventPrifix + "-participant-mode-changed",
|
|
39
|
+
'transcription-state-changed': eventPrifix + "-transcript-state-changed",
|
|
40
|
+
'transcription-text': eventPrifix + "-transcription-text"
|
|
39
41
|
};
|
|
40
42
|
var eventEmitter = new EventEmitter();
|
|
41
43
|
eventEmitter.setMaxListeners(9999);
|
|
@@ -298,7 +300,7 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
|
|
|
298
300
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MeetingProviderContex.Consumer, null, children));
|
|
299
301
|
};
|
|
300
302
|
|
|
301
|
-
var version = "0.1.
|
|
303
|
+
var version = "0.1.89";
|
|
302
304
|
|
|
303
305
|
var MeetingProvider = function MeetingProvider(_ref) {
|
|
304
306
|
var children = _ref.children,
|
|
@@ -371,6 +373,9 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
371
373
|
}),
|
|
372
374
|
hlsUrls = _useState20[0],
|
|
373
375
|
setHlsUrls = _useState20[1];
|
|
376
|
+
var _useState21 = useState('TRANSCRIPTION_STOPPED'),
|
|
377
|
+
transcriptionState = _useState21[0],
|
|
378
|
+
setTranscriptionState = _useState21[1];
|
|
374
379
|
var meetingRef = useRef();
|
|
375
380
|
var localMicOnRef = useRef();
|
|
376
381
|
var localWebcamOnRef = useRef();
|
|
@@ -648,6 +653,13 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
648
653
|
var _handle_meeting_state_changed = function _handle_meeting_state_changed(data) {
|
|
649
654
|
eventEmitter.emit(events['meeting-state-changed'], data);
|
|
650
655
|
};
|
|
656
|
+
var _handle_transcription_state_changed = function _handle_transcription_state_changed(data) {
|
|
657
|
+
setTranscriptionState(data === null || data === void 0 ? void 0 : data.status);
|
|
658
|
+
eventEmitter.emit(events['transcription-state-changed'], data);
|
|
659
|
+
};
|
|
660
|
+
var _handle_transcription_text = function _handle_transcription_text(data) {
|
|
661
|
+
eventEmitter.emit(events['transcription-text'], data);
|
|
662
|
+
};
|
|
651
663
|
var _handel_participant_mode_changed = function _handel_participant_mode_changed(data) {
|
|
652
664
|
var _meetingRef$current2, _meetingRef$current2$;
|
|
653
665
|
setParticipants(function (participants) {
|
|
@@ -703,6 +715,8 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
703
715
|
meeting.on('livestream-state-changed', _handle_livestream_state_changed);
|
|
704
716
|
meeting.on('hls-state-changed', _handle_hls_state_changed);
|
|
705
717
|
meeting.on('participant-mode-changed', _handel_participant_mode_changed);
|
|
718
|
+
meeting.on('transcription-state-changed', _handle_transcription_state_changed);
|
|
719
|
+
meeting.on('transcription-text', _handle_transcription_text);
|
|
706
720
|
meeting.localParticipant.on('stream-enabled', _handle_localParticipant_stream_enabled);
|
|
707
721
|
meeting.localParticipant.on('stream-disabled', _handle_localParticipant_stream_disabled);
|
|
708
722
|
meeting.join();
|
|
@@ -719,10 +733,10 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
719
733
|
meeting.end();
|
|
720
734
|
}
|
|
721
735
|
};
|
|
722
|
-
var startRecording = function startRecording(webhookUrl, awsDirPath, config) {
|
|
736
|
+
var startRecording = function startRecording(webhookUrl, awsDirPath, config, transcription) {
|
|
723
737
|
var meeting = meetingRef.current;
|
|
724
738
|
if (meeting) {
|
|
725
|
-
meeting.startRecording(webhookUrl, awsDirPath, config);
|
|
739
|
+
meeting.startRecording(webhookUrl, awsDirPath, config, transcription);
|
|
726
740
|
}
|
|
727
741
|
};
|
|
728
742
|
var stopRecording = function stopRecording() {
|
|
@@ -941,10 +955,10 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
941
955
|
return Promise.reject(e);
|
|
942
956
|
}
|
|
943
957
|
};
|
|
944
|
-
var startHls = function startHls(config) {
|
|
958
|
+
var startHls = function startHls(config, transcription) {
|
|
945
959
|
var meeting = meetingRef.current;
|
|
946
960
|
if (meeting) {
|
|
947
|
-
meeting.startHls(config);
|
|
961
|
+
meeting.startHls(config, transcription);
|
|
948
962
|
}
|
|
949
963
|
};
|
|
950
964
|
var stopHls = function stopHls() {
|
|
@@ -1000,6 +1014,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
1000
1014
|
livestreamState: livestreamState,
|
|
1001
1015
|
hlsState: hlsState,
|
|
1002
1016
|
hlsUrls: hlsUrls,
|
|
1017
|
+
transcriptionState: transcriptionState,
|
|
1003
1018
|
isMeetingJoined: isMeetingJoined,
|
|
1004
1019
|
selectedCameraDevice: meeting === null || meeting === void 0 ? void 0 : meeting.selectedCameraDevice,
|
|
1005
1020
|
selectedMicrophoneDevice: meeting === null || meeting === void 0 ? void 0 : meeting.selectedMicrophoneDevice,
|
|
@@ -1530,6 +1545,41 @@ var useMediaDevice = function useMediaDevice(_temp) {
|
|
|
1530
1545
|
};
|
|
1531
1546
|
};
|
|
1532
1547
|
|
|
1548
|
+
var useTranscription = function useTranscription(_temp) {
|
|
1549
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
1550
|
+
_ref$onTranscriptionS = _ref.onTranscriptionStateChanged,
|
|
1551
|
+
onTranscriptionStateChanged = _ref$onTranscriptionS === void 0 ? function () {} : _ref$onTranscriptionS,
|
|
1552
|
+
_ref$onTranscriptionT = _ref.onTranscriptionText,
|
|
1553
|
+
onTranscriptionText = _ref$onTranscriptionT === void 0 ? function () {} : _ref$onTranscriptionT;
|
|
1554
|
+
var mMeeting = useMeeting();
|
|
1555
|
+
useEffect(function () {
|
|
1556
|
+
eventEmitter.on(events['transcription-state-changed'], onTranscriptionStateChanged);
|
|
1557
|
+
eventEmitter.on(events['transcription-text'], onTranscriptionText);
|
|
1558
|
+
return function () {
|
|
1559
|
+
eventEmitter.off(events['transcription-state-changed'], onTranscriptionStateChanged);
|
|
1560
|
+
eventEmitter.off(events['transcription-text'], onTranscriptionText);
|
|
1561
|
+
};
|
|
1562
|
+
}, []);
|
|
1563
|
+
var startTranscription = function startTranscription(config) {
|
|
1564
|
+
try {
|
|
1565
|
+
return Promise.resolve(mMeeting.meeting.startTranscription(config));
|
|
1566
|
+
} catch (e) {
|
|
1567
|
+
return Promise.reject(e);
|
|
1568
|
+
}
|
|
1569
|
+
};
|
|
1570
|
+
var stopTranscription = function stopTranscription() {
|
|
1571
|
+
try {
|
|
1572
|
+
return Promise.resolve(mMeeting.meeting.stopTranscription());
|
|
1573
|
+
} catch (e) {
|
|
1574
|
+
return Promise.reject(e);
|
|
1575
|
+
}
|
|
1576
|
+
};
|
|
1577
|
+
return {
|
|
1578
|
+
startTranscription: startTranscription,
|
|
1579
|
+
stopTranscription: stopTranscription
|
|
1580
|
+
};
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1533
1583
|
var Constants = VideoSDK.Constants;
|
|
1534
1584
|
var createCameraVideoTrack = function createCameraVideoTrack(_ref) {
|
|
1535
1585
|
var _ref$cameraId = _ref.cameraId,
|
|
@@ -1600,5 +1650,5 @@ var getNetworkStats = function getNetworkStats(_temp) {
|
|
|
1600
1650
|
}
|
|
1601
1651
|
};
|
|
1602
1652
|
|
|
1603
|
-
export { Constants, MeetingConsumer, MeetingProvider, createCameraVideoTrack, createMicrophoneAudioTrack, createScreenShareVideoTrack, getNetworkStats, useConnection, useFile, useMediaDevice, useMeeting, useParticipant, usePubSub };
|
|
1653
|
+
export { Constants, MeetingConsumer, MeetingProvider, createCameraVideoTrack, createMicrophoneAudioTrack, createScreenShareVideoTrack, getNetworkStats, useConnection, useFile, useMediaDevice, useMeeting, useParticipant, usePubSub, useTranscription };
|
|
1604
1654
|
//# sourceMappingURL=index.modern.js.map
|