@videosdk.live/react-sdk 0.1.81 → 0.1.83

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.
@@ -297,7 +297,7 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
297
297
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MeetingProviderContex.Consumer, null, children));
298
298
  };
299
299
 
300
- var version = "0.1.81";
300
+ var version = "0.1.83";
301
301
 
302
302
  var MeetingProvider = function MeetingProvider(_ref) {
303
303
  var children = _ref.children,
@@ -653,7 +653,8 @@ var MeetingProvider = function MeetingProvider(_ref) {
653
653
  var part = participants.get(data.participantId);
654
654
  part.mode = data.mode;
655
655
  participants.set(part.id, part);
656
- return participants;
656
+ var participantsToSet = new Map(participants);
657
+ return participantsToSet;
657
658
  });
658
659
  if (data.participantId === (meetingRef === null || meetingRef === void 0 ? void 0 : (_meetingRef$current2 = meetingRef.current) === null || _meetingRef$current2 === void 0 ? void 0 : (_meetingRef$current2$ = _meetingRef$current2.localParticipant) === null || _meetingRef$current2$ === void 0 ? void 0 : _meetingRef$current2$.id)) {
659
660
  setLocalParticipant(function (participant) {
@@ -1458,6 +1459,74 @@ var useFile = function useFile() {
1458
1459
  };
1459
1460
  };
1460
1461
 
1462
+ var useMediaDevice = function useMediaDevice(_temp) {
1463
+ var _ref = _temp === void 0 ? {} : _temp,
1464
+ _ref$onDeviceChanged = _ref.onDeviceChanged,
1465
+ onDeviceChanged = _ref$onDeviceChanged === void 0 ? function () {} : _ref$onDeviceChanged;
1466
+ var getDevices = function getDevices() {
1467
+ try {
1468
+ return Promise.resolve(VideoSDK.getDevices());
1469
+ } catch (e) {
1470
+ return Promise.reject(e);
1471
+ }
1472
+ };
1473
+ var getCameras = function getCameras() {
1474
+ try {
1475
+ return Promise.resolve(VideoSDK.getCameras());
1476
+ } catch (e) {
1477
+ return Promise.reject(e);
1478
+ }
1479
+ };
1480
+ var getMicrophones = function getMicrophones() {
1481
+ try {
1482
+ return Promise.resolve(VideoSDK.getMicrophones());
1483
+ } catch (e) {
1484
+ return Promise.reject(e);
1485
+ }
1486
+ };
1487
+ var getPlaybackDevices = function getPlaybackDevices() {
1488
+ try {
1489
+ return Promise.resolve(VideoSDK.getPlaybackDevices());
1490
+ } catch (e) {
1491
+ return Promise.reject(e);
1492
+ }
1493
+ };
1494
+ var checkPermissions = function checkPermissions(permissions) {
1495
+ if (permissions === void 0) {
1496
+ permissions = undefined;
1497
+ }
1498
+ try {
1499
+ return Promise.resolve(VideoSDK.checkPermissions(permissions));
1500
+ } catch (e) {
1501
+ return Promise.reject(e);
1502
+ }
1503
+ };
1504
+ var requestPermission = function requestPermission(permissions) {
1505
+ if (permissions === void 0) {
1506
+ permissions = undefined;
1507
+ }
1508
+ try {
1509
+ return Promise.resolve(VideoSDK.requestPermission(permissions));
1510
+ } catch (e) {
1511
+ return Promise.reject(e);
1512
+ }
1513
+ };
1514
+ useEffect(function () {
1515
+ VideoSDK.on('device-changed', onDeviceChanged);
1516
+ return function () {
1517
+ VideoSDK.off('device-changed', onDeviceChanged);
1518
+ };
1519
+ }, []);
1520
+ return {
1521
+ getDevices: getDevices,
1522
+ getCameras: getCameras,
1523
+ getMicrophones: getMicrophones,
1524
+ getPlaybackDevices: getPlaybackDevices,
1525
+ requestPermission: requestPermission,
1526
+ checkPermissions: checkPermissions
1527
+ };
1528
+ };
1529
+
1461
1530
  var Constants = VideoSDK.Constants;
1462
1531
  var createCameraVideoTrack = function createCameraVideoTrack(_ref) {
1463
1532
  var _ref$cameraId = _ref.cameraId,
@@ -1516,6 +1585,17 @@ var createMicrophoneAudioTrack = function createMicrophoneAudioTrack(_ref3) {
1516
1585
  return Promise.reject(e);
1517
1586
  }
1518
1587
  };
1588
+ var getNetworkStats = function getNetworkStats(_temp) {
1589
+ var _ref4 = _temp === void 0 ? {} : _temp,
1590
+ timeoutDuration = _ref4.timeoutDuration;
1591
+ try {
1592
+ return Promise.resolve(VideoSDK.getNetworkStats({
1593
+ timeoutDuration: timeoutDuration
1594
+ }));
1595
+ } catch (e) {
1596
+ return Promise.reject(e);
1597
+ }
1598
+ };
1519
1599
 
1520
- export { Constants, MeetingConsumer, MeetingProvider, createCameraVideoTrack, createMicrophoneAudioTrack, createScreenShareVideoTrack, useConnection, useFile, useMeeting, useParticipant, usePubSub };
1600
+ export { Constants, MeetingConsumer, MeetingProvider, createCameraVideoTrack, createMicrophoneAudioTrack, createScreenShareVideoTrack, getNetworkStats, useConnection, useFile, useMediaDevice, useMeeting, useParticipant, usePubSub };
1521
1601
  //# sourceMappingURL=index.modern.js.map