@videosdk.live/react-sdk 0.4.2 → 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.
@@ -444,7 +444,7 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
444
444
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MeetingProviderContex.Consumer, null, children));
445
445
  };
446
446
 
447
- var version = "0.4.2";
447
+ var version = "0.4.3";
448
448
 
449
449
  var MeetingProvider = function MeetingProvider(_ref) {
450
450
  var children = _ref.children,
@@ -481,49 +481,49 @@ var MeetingProvider = function MeetingProvider(_ref) {
481
481
  var _useState9 = useState(false),
482
482
  isRecording = _useState9[0],
483
483
  setIsRecording = _useState9[1];
484
- var _useState10 = useState([]),
485
- messages = _useState10[0],
486
- setMessages = _useState10[1];
484
+ var _useState0 = useState([]),
485
+ messages = _useState0[0],
486
+ setMessages = _useState0[1];
487
+ var _useState1 = useState(new Map()),
488
+ participants = _useState1[0],
489
+ setParticipants = _useState1[1];
490
+ var _useState10 = useState(new Map()),
491
+ characters = _useState10[0],
492
+ setCharacters = _useState10[1];
487
493
  var _useState11 = useState(new Map()),
488
- participants = _useState11[0],
489
- setParticipants = _useState11[1];
490
- var _useState12 = useState(new Map()),
491
- characters = _useState12[0],
492
- setCharacters = _useState12[1];
494
+ pinnedParticipants = _useState11[0],
495
+ setPinnedParticipants = _useState11[1];
496
+ var _useState12 = useState(false),
497
+ isLiveStreaming = _useState12[0],
498
+ setIsLiveStreaming = _useState12[1];
493
499
  var _useState13 = useState(new Map()),
494
- pinnedParticipants = _useState13[0],
495
- setPinnedParticipants = _useState13[1];
500
+ connections = _useState13[0],
501
+ setConnections = _useState13[1];
496
502
  var _useState14 = useState(false),
497
- isLiveStreaming = _useState14[0],
498
- setIsLiveStreaming = _useState14[1];
499
- var _useState15 = useState(new Map()),
500
- connections = _useState15[0],
501
- setConnections = _useState15[1];
502
- var _useState16 = useState(false),
503
- isMeetingJoined = _useState16[0],
504
- setIsMeetingJoined = _useState16[1];
505
- var _useState17 = useState(false),
506
- isHls = _useState17[0],
507
- setIsHls = _useState17[1];
508
- var _useState18 = useState('RECORDING_STOPPED'),
509
- recordingState = _useState18[0],
510
- setRecordingState = _useState18[1];
511
- var _useState19 = useState('LIVESTREAM_STOPPED'),
512
- livestreamState = _useState19[0],
513
- setLivestreamState = _useState19[1];
514
- var _useState20 = useState('HLS_STOPPED'),
515
- hlsState = _useState20[0],
516
- setHlsState = _useState20[1];
517
- var _useState21 = useState({
503
+ isMeetingJoined = _useState14[0],
504
+ setIsMeetingJoined = _useState14[1];
505
+ var _useState15 = useState(false),
506
+ isHls = _useState15[0],
507
+ setIsHls = _useState15[1];
508
+ var _useState16 = useState('RECORDING_STOPPED'),
509
+ recordingState = _useState16[0],
510
+ setRecordingState = _useState16[1];
511
+ var _useState17 = useState('LIVESTREAM_STOPPED'),
512
+ livestreamState = _useState17[0],
513
+ setLivestreamState = _useState17[1];
514
+ var _useState18 = useState('HLS_STOPPED'),
515
+ hlsState = _useState18[0],
516
+ setHlsState = _useState18[1];
517
+ var _useState19 = useState({
518
518
  downstreamUrl: null,
519
519
  playbackHlsUrl: null,
520
520
  livestreamUrl: null
521
521
  }),
522
- hlsUrls = _useState21[0],
523
- setHlsUrls = _useState21[1];
524
- var _useState22 = useState('TRANSCRIPTION_STOPPED'),
525
- transcriptionState = _useState22[0],
526
- setTranscriptionState = _useState22[1];
522
+ hlsUrls = _useState19[0],
523
+ setHlsUrls = _useState19[1];
524
+ var _useState20 = useState('TRANSCRIPTION_STOPPED'),
525
+ transcriptionState = _useState20[0],
526
+ setTranscriptionState = _useState20[1];
527
527
  var meetingRef = useRef();
528
528
  var localMicOnRef = useRef();
529
529
  var localWebcamOnRef = useRef();
@@ -739,8 +739,14 @@ var MeetingProvider = function MeetingProvider(_ref) {
739
739
  meeting.off('whiteboard-stopped', _handle_whiteboard_stopped);
740
740
  meeting.off('whiteboard-started', _handle_whiteboard_started);
741
741
  meeting.off('transcription-state-changed', _handle_transcription_state_changed);
742
+ meeting.off('transcription-text', _handle_transcription_text);
742
743
  meeting.off('character-joined', _handle_character_joined);
743
744
  meeting.off('character-left', _handle_character_left);
745
+ meeting.off('media-relay-started', _handle_media_relay_started);
746
+ meeting.off('media-relay-stopped', _handle_media_relay_stopped);
747
+ meeting.off('media-relay-error', _handle_media_relay_error);
748
+ meeting.off('media-relay-request-response', _handle_media_relay_request_response);
749
+ meeting.off('media-relay-request-received', _handle_media_relay_request_received);
744
750
  }
745
751
  if (typeof (meeting === null || meeting === void 0 ? void 0 : (_meeting$localPartici = meeting.localParticipant) === null || _meeting$localPartici === void 0 ? void 0 : _meeting$localPartici.off) === 'function') {
746
752
  meeting.localParticipant.off('stream-enabled', _handle_localParticipant_stream_enabled);
@@ -1229,9 +1235,9 @@ var MeetingProvider = function MeetingProvider(_ref) {
1229
1235
  meeting.stopLivestream();
1230
1236
  }
1231
1237
  };
1232
- var connectTo = function connectTo(_ref10) {
1233
- var meetingId = _ref10.meetingId,
1234
- payload = _ref10.payload;
1238
+ var connectTo = function connectTo(_ref0) {
1239
+ var meetingId = _ref0.meetingId,
1240
+ payload = _ref0.payload;
1235
1241
  try {
1236
1242
  var _meeting4 = meetingRef.current;
1237
1243
  var _temp = function () {
@@ -1473,6 +1479,12 @@ var useParticipant = function useParticipant(participantId, _temp) {
1473
1479
  setTrack(stream);
1474
1480
  onStreamEnabled(stream);
1475
1481
  };
1482
+ var _handleStreamPaused = function _handleStreamPaused(data) {
1483
+ onStreamPaused(data);
1484
+ };
1485
+ var _handleStreamResumed = function _handleStreamResumed(data) {
1486
+ onStreamResumed(data);
1487
+ };
1476
1488
  var _handleParticipantModeChanged = function _handleParticipantModeChanged(data) {
1477
1489
  if (participantId === data.participantId) {
1478
1490
  setMode(data.mode);
@@ -1507,6 +1519,18 @@ var useParticipant = function useParticipant(participantId, _temp) {
1507
1519
  newStatus: newStatus
1508
1520
  });
1509
1521
  };
1522
+ var _handleProducerAdded = function _handleProducerAdded(data) {
1523
+ onProducerAdded(data);
1524
+ };
1525
+ var _handleProducerRemoved = function _handleProducerRemoved(data) {
1526
+ onProducerRemoved(data);
1527
+ };
1528
+ var _handleConsumerAdded = function _handleConsumerAdded(data) {
1529
+ onConsumerAdded(data);
1530
+ };
1531
+ var _handleConsumerRemoved = function _handleConsumerRemoved(data) {
1532
+ onConsumerRemoved(data);
1533
+ };
1510
1534
  var setQuality = function setQuality(quality) {
1511
1535
  participant === null || participant === void 0 ? void 0 : participant.setQuality(quality);
1512
1536
  };
@@ -1585,32 +1609,26 @@ var useParticipant = function useParticipant(participantId, _temp) {
1585
1609
  }
1586
1610
  participant === null || participant === void 0 ? void 0 : participant.on('stream-enabled', _handleStreamEnabled);
1587
1611
  participant === null || participant === void 0 ? void 0 : participant.on('stream-disabled', _handleStreamDisabled);
1588
- participant === null || participant === void 0 ? void 0 : participant.on('stream-paused', function (data) {
1589
- onStreamPaused(data);
1590
- });
1591
- participant === null || participant === void 0 ? void 0 : participant.on('stream-resumed', function (data) {
1592
- onStreamResumed(data);
1593
- });
1612
+ participant === null || participant === void 0 ? void 0 : participant.on('stream-paused', _handleStreamPaused);
1613
+ participant === null || participant === void 0 ? void 0 : participant.on('stream-resumed', _handleStreamResumed);
1594
1614
  participant === null || participant === void 0 ? void 0 : participant.on('media-status-changed', _handleMediaStatusChanged);
1595
1615
  participant === null || participant === void 0 ? void 0 : participant.on('video-quality-changed', _handleVideoQualityChanged);
1596
- participant === null || participant === void 0 ? void 0 : participant.on('producer-added', function (data) {
1597
- onProducerAdded(data);
1598
- });
1599
- participant === null || participant === void 0 ? void 0 : participant.on('producer-removed', function (data) {
1600
- onProducerRemoved(data);
1601
- });
1602
- participant === null || participant === void 0 ? void 0 : participant.on('consumer-added', function (data) {
1603
- onConsumerAdded(data);
1604
- });
1605
- participant === null || participant === void 0 ? void 0 : participant.on('consumer-removed', function (data) {
1606
- onConsumerRemoved(data);
1607
- });
1616
+ participant === null || participant === void 0 ? void 0 : participant.on('producer-added', _handleProducerAdded);
1617
+ participant === null || participant === void 0 ? void 0 : participant.on('producer-removed', _handleProducerRemoved);
1618
+ participant === null || participant === void 0 ? void 0 : participant.on('consumer-added', _handleConsumerAdded);
1619
+ participant === null || participant === void 0 ? void 0 : participant.on('consumer-removed', _handleConsumerRemoved);
1608
1620
  eventEmitter.on(events['participant-mode-changed'], _handleParticipantModeChanged);
1609
1621
  return function () {
1610
1622
  participant === null || participant === void 0 ? void 0 : participant.off('stream-enabled', _handleStreamEnabled);
1611
1623
  participant === null || participant === void 0 ? void 0 : participant.off('stream-disabled', _handleStreamDisabled);
1624
+ participant === null || participant === void 0 ? void 0 : participant.off('stream-paused', _handleStreamPaused);
1625
+ participant === null || participant === void 0 ? void 0 : participant.off('stream-resumed', _handleStreamResumed);
1612
1626
  participant === null || participant === void 0 ? void 0 : participant.off('media-status-changed', _handleMediaStatusChanged);
1613
1627
  participant === null || participant === void 0 ? void 0 : participant.off('video-quality-changed', _handleVideoQualityChanged);
1628
+ participant === null || participant === void 0 ? void 0 : participant.off('producer-added', _handleProducerAdded);
1629
+ participant === null || participant === void 0 ? void 0 : participant.off('producer-removed', _handleProducerRemoved);
1630
+ participant === null || participant === void 0 ? void 0 : participant.off('consumer-added', _handleConsumerAdded);
1631
+ participant === null || participant === void 0 ? void 0 : participant.off('consumer-removed', _handleConsumerRemoved);
1614
1632
  eventEmitter.off(events['participant-mode-changed'], _handleParticipantModeChanged);
1615
1633
  };
1616
1634
  }, [participant]);