@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.
- package/dist/index.js +59 -6
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +59 -7
- package/dist/index.modern.js.map +1 -1
- package/dist/types/index.d.ts +77 -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 + "-transcription-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.90";
|
|
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();
|
|
@@ -427,6 +432,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
427
432
|
setRecordingState('RECORDING_STOPPED');
|
|
428
433
|
setLivestreamState('LIVESTREAM_STOPPED');
|
|
429
434
|
setHlsState('HLS_STOPPED');
|
|
435
|
+
setTranscriptionState('TRANSCRIPTION_STOPPED');
|
|
430
436
|
setHlsUrls({
|
|
431
437
|
downstreamUrl: null,
|
|
432
438
|
playbackHlsUrl: null,
|
|
@@ -571,6 +577,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
571
577
|
meeting.off('livestream-state-changed', _handle_livestream_state_changed);
|
|
572
578
|
meeting.off('hls-state-changed', _handle_hls_state_changed);
|
|
573
579
|
meeting.off('participant-mode-changed', _handel_participant_mode_changed);
|
|
580
|
+
meeting.off('transcription-state-changed', _handle_transcription_state_changed);
|
|
574
581
|
}
|
|
575
582
|
if (typeof (meeting === null || meeting === void 0 ? void 0 : (_meeting$localPartici = meeting.localParticipant) === null || _meeting$localPartici === void 0 ? void 0 : _meeting$localPartici.off) === 'function') {
|
|
576
583
|
meeting.localParticipant.off('stream-enabled', _handle_localParticipant_stream_enabled);
|
|
@@ -648,6 +655,13 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
648
655
|
var _handle_meeting_state_changed = function _handle_meeting_state_changed(data) {
|
|
649
656
|
eventEmitter.emit(events['meeting-state-changed'], data);
|
|
650
657
|
};
|
|
658
|
+
var _handle_transcription_state_changed = function _handle_transcription_state_changed(data) {
|
|
659
|
+
setTranscriptionState(data === null || data === void 0 ? void 0 : data.status);
|
|
660
|
+
eventEmitter.emit(events['transcription-state-changed'], data);
|
|
661
|
+
};
|
|
662
|
+
var _handle_transcription_text = function _handle_transcription_text(data) {
|
|
663
|
+
eventEmitter.emit(events['transcription-text'], data);
|
|
664
|
+
};
|
|
651
665
|
var _handel_participant_mode_changed = function _handel_participant_mode_changed(data) {
|
|
652
666
|
var _meetingRef$current2, _meetingRef$current2$;
|
|
653
667
|
setParticipants(function (participants) {
|
|
@@ -703,6 +717,8 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
703
717
|
meeting.on('livestream-state-changed', _handle_livestream_state_changed);
|
|
704
718
|
meeting.on('hls-state-changed', _handle_hls_state_changed);
|
|
705
719
|
meeting.on('participant-mode-changed', _handel_participant_mode_changed);
|
|
720
|
+
meeting.on('transcription-state-changed', _handle_transcription_state_changed);
|
|
721
|
+
meeting.on('transcription-text', _handle_transcription_text);
|
|
706
722
|
meeting.localParticipant.on('stream-enabled', _handle_localParticipant_stream_enabled);
|
|
707
723
|
meeting.localParticipant.on('stream-disabled', _handle_localParticipant_stream_disabled);
|
|
708
724
|
meeting.join();
|
|
@@ -719,10 +735,10 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
719
735
|
meeting.end();
|
|
720
736
|
}
|
|
721
737
|
};
|
|
722
|
-
var startRecording = function startRecording(webhookUrl, awsDirPath, config) {
|
|
738
|
+
var startRecording = function startRecording(webhookUrl, awsDirPath, config, transcription) {
|
|
723
739
|
var meeting = meetingRef.current;
|
|
724
740
|
if (meeting) {
|
|
725
|
-
meeting.startRecording(webhookUrl, awsDirPath, config);
|
|
741
|
+
meeting.startRecording(webhookUrl, awsDirPath, config, transcription);
|
|
726
742
|
}
|
|
727
743
|
};
|
|
728
744
|
var stopRecording = function stopRecording() {
|
|
@@ -941,10 +957,10 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
941
957
|
return Promise.reject(e);
|
|
942
958
|
}
|
|
943
959
|
};
|
|
944
|
-
var startHls = function startHls(config) {
|
|
960
|
+
var startHls = function startHls(config, transcription) {
|
|
945
961
|
var meeting = meetingRef.current;
|
|
946
962
|
if (meeting) {
|
|
947
|
-
meeting.startHls(config);
|
|
963
|
+
meeting.startHls(config, transcription);
|
|
948
964
|
}
|
|
949
965
|
};
|
|
950
966
|
var stopHls = function stopHls() {
|
|
@@ -1000,6 +1016,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
|
|
|
1000
1016
|
livestreamState: livestreamState,
|
|
1001
1017
|
hlsState: hlsState,
|
|
1002
1018
|
hlsUrls: hlsUrls,
|
|
1019
|
+
transcriptionState: transcriptionState,
|
|
1003
1020
|
isMeetingJoined: isMeetingJoined,
|
|
1004
1021
|
selectedCameraDevice: meeting === null || meeting === void 0 ? void 0 : meeting.selectedCameraDevice,
|
|
1005
1022
|
selectedMicrophoneDevice: meeting === null || meeting === void 0 ? void 0 : meeting.selectedMicrophoneDevice,
|
|
@@ -1530,6 +1547,41 @@ var useMediaDevice = function useMediaDevice(_temp) {
|
|
|
1530
1547
|
};
|
|
1531
1548
|
};
|
|
1532
1549
|
|
|
1550
|
+
var useTranscription = function useTranscription(_temp) {
|
|
1551
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
1552
|
+
_ref$onTranscriptionS = _ref.onTranscriptionStateChanged,
|
|
1553
|
+
onTranscriptionStateChanged = _ref$onTranscriptionS === void 0 ? function () {} : _ref$onTranscriptionS,
|
|
1554
|
+
_ref$onTranscriptionT = _ref.onTranscriptionText,
|
|
1555
|
+
onTranscriptionText = _ref$onTranscriptionT === void 0 ? function () {} : _ref$onTranscriptionT;
|
|
1556
|
+
var mMeeting = useMeeting();
|
|
1557
|
+
useEffect(function () {
|
|
1558
|
+
eventEmitter.on(events['transcription-state-changed'], onTranscriptionStateChanged);
|
|
1559
|
+
eventEmitter.on(events['transcription-text'], onTranscriptionText);
|
|
1560
|
+
return function () {
|
|
1561
|
+
eventEmitter.off(events['transcription-state-changed'], onTranscriptionStateChanged);
|
|
1562
|
+
eventEmitter.off(events['transcription-text'], onTranscriptionText);
|
|
1563
|
+
};
|
|
1564
|
+
}, []);
|
|
1565
|
+
var startTranscription = function startTranscription(config) {
|
|
1566
|
+
try {
|
|
1567
|
+
return Promise.resolve(mMeeting.meeting.startTranscription(config));
|
|
1568
|
+
} catch (e) {
|
|
1569
|
+
return Promise.reject(e);
|
|
1570
|
+
}
|
|
1571
|
+
};
|
|
1572
|
+
var stopTranscription = function stopTranscription() {
|
|
1573
|
+
try {
|
|
1574
|
+
return Promise.resolve(mMeeting.meeting.stopTranscription());
|
|
1575
|
+
} catch (e) {
|
|
1576
|
+
return Promise.reject(e);
|
|
1577
|
+
}
|
|
1578
|
+
};
|
|
1579
|
+
return {
|
|
1580
|
+
startTranscription: startTranscription,
|
|
1581
|
+
stopTranscription: stopTranscription
|
|
1582
|
+
};
|
|
1583
|
+
};
|
|
1584
|
+
|
|
1533
1585
|
var Constants = VideoSDK.Constants;
|
|
1534
1586
|
var createCameraVideoTrack = function createCameraVideoTrack(_ref) {
|
|
1535
1587
|
var _ref$cameraId = _ref.cameraId,
|
|
@@ -1600,5 +1652,5 @@ var getNetworkStats = function getNetworkStats(_temp) {
|
|
|
1600
1652
|
}
|
|
1601
1653
|
};
|
|
1602
1654
|
|
|
1603
|
-
export { Constants, MeetingConsumer, MeetingProvider, createCameraVideoTrack, createMicrophoneAudioTrack, createScreenShareVideoTrack, getNetworkStats, useConnection, useFile, useMediaDevice, useMeeting, useParticipant, usePubSub };
|
|
1655
|
+
export { Constants, MeetingConsumer, MeetingProvider, createCameraVideoTrack, createMicrophoneAudioTrack, createScreenShareVideoTrack, getNetworkStats, useConnection, useFile, useMediaDevice, useMeeting, useParticipant, usePubSub, useTranscription };
|
|
1604
1656
|
//# sourceMappingURL=index.modern.js.map
|