@videosdk.live/react-sdk 0.1.67 → 0.1.69

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/README.md CHANGED
@@ -37,7 +37,7 @@
37
37
  Visit our official guide for [Browser Support](https://docs.videosdk.live/docs/realtime-communication/see-also/device-browser-support)
38
38
 
39
39
  ## Demo App
40
- Check out demo [here](https://videosdk.live/prebuilt/)
40
+ Check out demo [here](https://demo.videosdk.live/conference-meeting/)
41
41
 
42
42
  ## Prerequisites
43
43
 
@@ -80,7 +80,7 @@ import {
80
80
 
81
81
  ## Documentation
82
82
 
83
- Check the components and their usage in our [documentation](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/getting-started).
83
+ Check the components and their usage in our [documentation](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/concept-and-architecture).
84
84
 
85
85
  ## Quick Start
86
86
 
package/dist/index.js CHANGED
@@ -33,6 +33,7 @@ var events = {
33
33
  'hls-started': eventPrifix + "-hls-started",
34
34
  'hls-stopped': eventPrifix + "-hls-stopped",
35
35
  'hls-state-changed': eventPrifix + "-hls-state-changed",
36
+ 'hls-playable-state-changed': eventPrifix + "-hls-playable-state-changed",
36
37
  'recording-state-changed': eventPrifix + "-recording-state-changed",
37
38
  'livestream-state-changed': eventPrifix + "-livestream-state-changed",
38
39
  'meeting-state-changed': eventPrifix + "-meeting-state-changed",
@@ -299,7 +300,7 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
299
300
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MeetingProviderContex.Consumer, null, children));
300
301
  };
301
302
 
302
- var version = "0.1.66";
303
+ var version = "0.1.69";
303
304
 
304
305
  var MeetingProvider = function MeetingProvider(_ref) {
305
306
  var children = _ref.children,
@@ -356,15 +357,22 @@ var MeetingProvider = function MeetingProvider(_ref) {
356
357
  var _useState16 = React.useState(false),
357
358
  isHls = _useState16[0],
358
359
  setIsHls = _useState16[1];
359
- var _useState17 = React.useState(null),
360
+ var _useState17 = React.useState('RECORDING_STOPPED'),
360
361
  recordingState = _useState17[0],
361
362
  setRecordingState = _useState17[1];
362
- var _useState18 = React.useState(null),
363
+ var _useState18 = React.useState('LIVESTREAM_STOPPED'),
363
364
  livestreamState = _useState18[0],
364
365
  setLivestreamState = _useState18[1];
365
- var _useState19 = React.useState(null),
366
+ var _useState19 = React.useState('HLS_STOPPED'),
366
367
  hlsState = _useState19[0],
367
368
  setHlsState = _useState19[1];
369
+ var _useState20 = React.useState({
370
+ downstreamUrl: null,
371
+ playbackHlsUrl: null,
372
+ livestreamUrl: null
373
+ }),
374
+ hlsUrls = _useState20[0],
375
+ setHlsUrls = _useState20[1];
368
376
  var meetingRef = React.useRef();
369
377
  var localMicOnRef = React.useRef();
370
378
  var localWebcamOnRef = React.useRef();
@@ -418,9 +426,14 @@ var MeetingProvider = function MeetingProvider(_ref) {
418
426
  setConnections(new Map());
419
427
  setIsMeetingJoined(false);
420
428
  setIsHls(false);
421
- setRecordingState(null);
422
- setLivestreamState(null);
423
- setHlsState(null);
429
+ setRecordingState('RECORDING_STOPPED');
430
+ setLivestreamState('LIVESTREAM_STOPPED');
431
+ setHlsState('HLS_STOPPED');
432
+ setHlsUrls({
433
+ downstreamUrl: null,
434
+ playbackHlsUrl: null,
435
+ livestreamUrl: null
436
+ });
424
437
  };
425
438
  var _handle_participant_joined = function _handle_participant_joined(participant) {
426
439
  setParticipants(function (participants) {
@@ -621,6 +634,19 @@ var MeetingProvider = function MeetingProvider(_ref) {
621
634
  };
622
635
  var _handle_hls_state_changed = function _handle_hls_state_changed(data) {
623
636
  setHlsState(data === null || data === void 0 ? void 0 : data.status);
637
+ if ((data === null || data === void 0 ? void 0 : data.status) == 'HLS_PLAYABLE') {
638
+ setHlsUrls({
639
+ downstreamUrl: data === null || data === void 0 ? void 0 : data.downstreamUrl,
640
+ playbackHlsUrl: data === null || data === void 0 ? void 0 : data.playbackHlsUrl,
641
+ livestreamUrl: data === null || data === void 0 ? void 0 : data.livestreamUrl
642
+ });
643
+ } else if ((data === null || data === void 0 ? void 0 : data.status) == 'HLS_STOPPED') {
644
+ setHlsUrls({
645
+ downstreamUrl: null,
646
+ playbackHlsUrl: null,
647
+ livestreamUrl: null
648
+ });
649
+ }
624
650
  eventEmitter.emit(events['hls-state-changed'], data);
625
651
  };
626
652
  var _handle_meeting_state_changed = function _handle_meeting_state_changed(data) {
@@ -837,6 +863,12 @@ var MeetingProvider = function MeetingProvider(_ref) {
837
863
  meeting.changeWebcam(obj);
838
864
  }
839
865
  };
866
+ var replaceWebcamStream = function replaceWebcamStream(stream) {
867
+ var meeting = meetingRef.current;
868
+ if (meeting) {
869
+ meeting.replaceWebcamStream(stream);
870
+ }
871
+ };
840
872
  var changeMic = function changeMic(obj) {
841
873
  var meeting = meetingRef.current;
842
874
  if (meeting) {
@@ -970,6 +1002,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
970
1002
  recordingState: recordingState,
971
1003
  livestreamState: livestreamState,
972
1004
  hlsState: hlsState,
1005
+ hlsUrls: hlsUrls,
973
1006
  isMeetingJoined: isMeetingJoined,
974
1007
  join: join,
975
1008
  leave: leave,
@@ -990,6 +1023,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
990
1023
  getMics: getMics,
991
1024
  getWebcams: getWebcams,
992
1025
  changeWebcam: changeWebcam,
1026
+ replaceWebcamStream: replaceWebcamStream,
993
1027
  changeMic: changeMic,
994
1028
  changeMode: changeMode,
995
1029
  startVideo: startVideo,
@@ -1172,6 +1206,9 @@ var useParticipant = function useParticipant(participantId, _temp) {
1172
1206
  var unpin = function unpin(data) {
1173
1207
  participant === null || participant === void 0 ? void 0 : participant.unpin(data);
1174
1208
  };
1209
+ var remove = function remove() {
1210
+ participant === null || participant === void 0 ? void 0 : participant.remove();
1211
+ };
1175
1212
  var getAudioStats = function getAudioStats() {
1176
1213
  return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.getAudioStats());
1177
1214
  };
@@ -1249,6 +1286,7 @@ var useParticipant = function useParticipant(participantId, _temp) {
1249
1286
  disableWebcam: disableWebcam,
1250
1287
  pin: pin,
1251
1288
  unpin: unpin,
1289
+ remove: remove,
1252
1290
  switchTo: switchTo,
1253
1291
  getAudioStats: getAudioStats,
1254
1292
  getVideoStats: getVideoStats,