@videosdk.live/react-sdk 0.1.67 → 0.1.68

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.67";
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) {
@@ -967,6 +993,7 @@ var MeetingProvider = function MeetingProvider(_ref) {
967
993
  recordingState: recordingState,
968
994
  livestreamState: livestreamState,
969
995
  hlsState: hlsState,
996
+ hlsUrls: hlsUrls,
970
997
  isMeetingJoined: isMeetingJoined,
971
998
  join: join,
972
999
  leave: leave,
@@ -1169,6 +1196,9 @@ var useParticipant = function useParticipant(participantId, _temp) {
1169
1196
  var unpin = function unpin(data) {
1170
1197
  participant === null || participant === void 0 ? void 0 : participant.unpin(data);
1171
1198
  };
1199
+ var remove = function remove() {
1200
+ participant === null || participant === void 0 ? void 0 : participant.remove();
1201
+ };
1172
1202
  var getAudioStats = function getAudioStats() {
1173
1203
  return Promise.resolve(participant === null || participant === void 0 ? void 0 : participant.getAudioStats());
1174
1204
  };
@@ -1246,6 +1276,7 @@ var useParticipant = function useParticipant(participantId, _temp) {
1246
1276
  disableWebcam: disableWebcam,
1247
1277
  pin: pin,
1248
1278
  unpin: unpin,
1279
+ remove: remove,
1249
1280
  switchTo: switchTo,
1250
1281
  getAudioStats: getAudioStats,
1251
1282
  getVideoStats: getVideoStats,