@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.
@@ -30,6 +30,7 @@ var events = {
30
30
  'hls-started': eventPrifix + "-hls-started",
31
31
  'hls-stopped': eventPrifix + "-hls-stopped",
32
32
  'hls-state-changed': eventPrifix + "-hls-state-changed",
33
+ 'hls-playable-state-changed': eventPrifix + "-hls-playable-state-changed",
33
34
  'recording-state-changed': eventPrifix + "-recording-state-changed",
34
35
  'livestream-state-changed': eventPrifix + "-livestream-state-changed",
35
36
  'meeting-state-changed': eventPrifix + "-meeting-state-changed",
@@ -296,7 +297,7 @@ var MeetingConsumer = function MeetingConsumer(_ref2) {
296
297
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MeetingProviderContex.Consumer, null, children));
297
298
  };
298
299
 
299
- var version = "0.1.66";
300
+ var version = "0.1.69";
300
301
 
301
302
  var MeetingProvider = function MeetingProvider(_ref) {
302
303
  var children = _ref.children,
@@ -353,15 +354,22 @@ var MeetingProvider = function MeetingProvider(_ref) {
353
354
  var _useState16 = useState(false),
354
355
  isHls = _useState16[0],
355
356
  setIsHls = _useState16[1];
356
- var _useState17 = useState(null),
357
+ var _useState17 = useState('RECORDING_STOPPED'),
357
358
  recordingState = _useState17[0],
358
359
  setRecordingState = _useState17[1];
359
- var _useState18 = useState(null),
360
+ var _useState18 = useState('LIVESTREAM_STOPPED'),
360
361
  livestreamState = _useState18[0],
361
362
  setLivestreamState = _useState18[1];
362
- var _useState19 = useState(null),
363
+ var _useState19 = useState('HLS_STOPPED'),
363
364
  hlsState = _useState19[0],
364
365
  setHlsState = _useState19[1];
366
+ var _useState20 = useState({
367
+ downstreamUrl: null,
368
+ playbackHlsUrl: null,
369
+ livestreamUrl: null
370
+ }),
371
+ hlsUrls = _useState20[0],
372
+ setHlsUrls = _useState20[1];
365
373
  var meetingRef = useRef();
366
374
  var localMicOnRef = useRef();
367
375
  var localWebcamOnRef = useRef();
@@ -415,9 +423,14 @@ var MeetingProvider = function MeetingProvider(_ref) {
415
423
  setConnections(new Map());
416
424
  setIsMeetingJoined(false);
417
425
  setIsHls(false);
418
- setRecordingState(null);
419
- setLivestreamState(null);
420
- setHlsState(null);
426
+ setRecordingState('RECORDING_STOPPED');
427
+ setLivestreamState('LIVESTREAM_STOPPED');
428
+ setHlsState('HLS_STOPPED');
429
+ setHlsUrls({
430
+ downstreamUrl: null,
431
+ playbackHlsUrl: null,
432
+ livestreamUrl: null
433
+ });
421
434
  };
422
435
  var _handle_participant_joined = function _handle_participant_joined(participant) {
423
436
  setParticipants(function (participants) {
@@ -618,6 +631,19 @@ var MeetingProvider = function MeetingProvider(_ref) {
618
631
  };
619
632
  var _handle_hls_state_changed = function _handle_hls_state_changed(data) {
620
633
  setHlsState(data === null || data === void 0 ? void 0 : data.status);
634
+ if ((data === null || data === void 0 ? void 0 : data.status) == 'HLS_PLAYABLE') {
635
+ setHlsUrls({
636
+ downstreamUrl: data === null || data === void 0 ? void 0 : data.downstreamUrl,
637
+ playbackHlsUrl: data === null || data === void 0 ? void 0 : data.playbackHlsUrl,
638
+ livestreamUrl: data === null || data === void 0 ? void 0 : data.livestreamUrl
639
+ });
640
+ } else if ((data === null || data === void 0 ? void 0 : data.status) == 'HLS_STOPPED') {
641
+ setHlsUrls({
642
+ downstreamUrl: null,
643
+ playbackHlsUrl: null,
644
+ livestreamUrl: null
645
+ });
646
+ }
621
647
  eventEmitter.emit(events['hls-state-changed'], data);
622
648
  };
623
649
  var _handle_meeting_state_changed = function _handle_meeting_state_changed(data) {
@@ -834,6 +860,12 @@ var MeetingProvider = function MeetingProvider(_ref) {
834
860
  meeting.changeWebcam(obj);
835
861
  }
836
862
  };
863
+ var replaceWebcamStream = function replaceWebcamStream(stream) {
864
+ var meeting = meetingRef.current;
865
+ if (meeting) {
866
+ meeting.replaceWebcamStream(stream);
867
+ }
868
+ };
837
869
  var changeMic = function changeMic(obj) {
838
870
  var meeting = meetingRef.current;
839
871
  if (meeting) {
@@ -967,6 +999,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
967
999
  recordingState: recordingState,
968
1000
  livestreamState: livestreamState,
969
1001
  hlsState: hlsState,
1002
+ hlsUrls: hlsUrls,
970
1003
  isMeetingJoined: isMeetingJoined,
971
1004
  join: join,
972
1005
  leave: leave,
@@ -987,6 +1020,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
987
1020
  getMics: getMics,
988
1021
  getWebcams: getWebcams,
989
1022
  changeWebcam: changeWebcam,
1023
+ replaceWebcamStream: replaceWebcamStream,
990
1024
  changeMic: changeMic,
991
1025
  changeMode: changeMode,
992
1026
  startVideo: startVideo,
@@ -1169,6 +1203,9 @@ var useParticipant = function useParticipant(participantId, _temp) {
1169
1203
  var unpin = function unpin(data) {
1170
1204
  participant === null || participant === void 0 ? void 0 : participant.unpin(data);
1171
1205
  };
1206
+ var remove = function remove() {
1207
+ participant === null || participant === void 0 ? void 0 : participant.remove();
1208
+ };
1172
1209
  var getAudioStats = function getAudioStats() {
1173
1210
  return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.getAudioStats());
1174
1211
  };
@@ -1246,6 +1283,7 @@ var useParticipant = function useParticipant(participantId, _temp) {
1246
1283
  disableWebcam: disableWebcam,
1247
1284
  pin: pin,
1248
1285
  unpin: unpin,
1286
+ remove: remove,
1249
1287
  switchTo: switchTo,
1250
1288
  getAudioStats: getAudioStats,
1251
1289
  getVideoStats: getVideoStats,