@100mslive/react-native-hms 1.9.1 → 1.9.3-beta.0
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 +0 -1
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +21 -11
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +72 -20
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +63 -28
- package/ios/HMSDecoder.swift +1 -3
- package/ios/HMSHelper.swift +2 -2
- package/ios/HMSRNSDK.swift +23 -7
- package/lib/commonjs/classes/HMSCameraControl.js +2 -3
- package/lib/commonjs/classes/HMSCameraControl.js.map +1 -1
- package/lib/commonjs/classes/HMSEncoder.js +1 -1
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSNativeEventListener.js +1 -1
- package/lib/commonjs/classes/HMSNativeEventListener.js.map +1 -1
- package/lib/commonjs/classes/HMSPeerListIterator.js +1 -1
- package/lib/commonjs/classes/HMSPeerListIterator.js.map +1 -1
- package/lib/commonjs/classes/HMSPeersCache.js +1 -1
- package/lib/commonjs/classes/HMSPeersCache.js.map +1 -1
- package/lib/commonjs/classes/HMSRoomCache.js +1 -1
- package/lib/commonjs/classes/HMSRoomCache.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +17 -57
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +3 -4
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +13 -16
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/hooks/useHMSPeerUpdates.js +1 -2
- package/lib/commonjs/hooks/useHMSPeerUpdates.js.map +1 -1
- package/lib/commonjs/index.js +11 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stores/hms-store.js +4 -6
- package/lib/commonjs/stores/hms-store.js.map +1 -1
- package/lib/commonjs/utils/emitter/EventEmitter.js +1 -4
- package/lib/commonjs/utils/emitter/EventEmitter.js.map +1 -1
- package/lib/commonjs/utils/notification.js +13 -0
- package/lib/commonjs/utils/notification.js.map +1 -0
- package/lib/module/classes/HMSCameraControl.js +2 -3
- package/lib/module/classes/HMSCameraControl.js.map +1 -1
- package/lib/module/classes/HMSEncoder.js +1 -1
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSNativeEventListener.js +1 -1
- package/lib/module/classes/HMSNativeEventListener.js.map +1 -1
- package/lib/module/classes/HMSPeerListIterator.js +1 -1
- package/lib/module/classes/HMSPeerListIterator.js.map +1 -1
- package/lib/module/classes/HMSPeersCache.js +1 -1
- package/lib/module/classes/HMSPeersCache.js.map +1 -1
- package/lib/module/classes/HMSRoomCache.js +1 -1
- package/lib/module/classes/HMSRoomCache.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +18 -58
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSSessionStore.js +1 -1
- package/lib/module/classes/HMSSessionStore.js.map +1 -1
- package/lib/module/classes/HmsView.js +3 -4
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +13 -16
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/module/hooks/useHMSPeerUpdates.js +1 -2
- package/lib/module/hooks/useHMSPeerUpdates.js.map +1 -1
- package/lib/module/index.js +5 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/stores/hms-store.js +4 -6
- package/lib/module/stores/hms-store.js.map +1 -1
- package/lib/module/utils/emitter/EventEmitter.js +1 -4
- package/lib/module/utils/emitter/EventEmitter.js.map +1 -1
- package/lib/module/utils/notification.js +5 -0
- package/lib/module/utils/notification.js.map +1 -0
- package/lib/typescript/classes/HMSSDK.d.ts +1 -11
- package/lib/typescript/index.d.ts +3 -1
- package/lib/typescript/utils/notification.d.ts +5 -0
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSCameraControl.ts +1 -1
- package/src/classes/HMSEncoder.ts +1 -1
- package/src/classes/HMSNativeEventListener.ts +1 -1
- package/src/classes/HMSPeerListIterator.ts +8 -6
- package/src/classes/HMSPeersCache.ts +1 -1
- package/src/classes/HMSRoomCache.ts +1 -1
- package/src/classes/HMSSDK.tsx +35 -61
- package/src/classes/HMSSessionStore.ts +1 -1
- package/src/index.ts +5 -1
- package/src/utils/notification.ts +10 -0
- /package/lib/commonjs/{classes → modules}/HMSManagerModule.js +0 -0
- /package/lib/commonjs/{classes → modules}/HMSManagerModule.js.map +0 -0
- /package/lib/module/{classes → modules}/HMSManagerModule.js +0 -0
- /package/lib/module/{classes → modules}/HMSManagerModule.js.map +0 -0
- /package/lib/typescript/{classes → modules}/HMSManagerModule.d.ts +0 -0
- /package/src/{classes → modules}/HMSManagerModule.ts +0 -0
|
@@ -9,10 +9,9 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _HMSEncoder = require("./HMSEncoder");
|
|
10
10
|
var _HMSHelper = require("./HMSHelper");
|
|
11
11
|
var _HMSLogger = require("./HMSLogger");
|
|
12
|
-
var _HMSTrackType = require("./HMSTrackType");
|
|
13
12
|
var _HMSUpdateListenerActions = require("./HMSUpdateListenerActions");
|
|
14
13
|
var _HmsView = require("./HmsView");
|
|
15
|
-
var _HMSManagerModule = _interopRequireDefault(require("
|
|
14
|
+
var _HMSManagerModule = _interopRequireDefault(require("../modules/HMSManagerModule"));
|
|
16
15
|
var _HMSPIPListenerActions = require("./HMSPIPListenerActions");
|
|
17
16
|
var _HMSNativeEventListener = _interopRequireDefault(require("./HMSNativeEventListener"));
|
|
18
17
|
var _HMSPeersCache = require("./HMSPeersCache");
|
|
@@ -28,9 +27,7 @@ const ReactNativeVersion = require('react-native/Libraries/Core/ReactNativeVersi
|
|
|
28
27
|
let HmsSdk;
|
|
29
28
|
class HMSSDK {
|
|
30
29
|
constructor(id) {
|
|
31
|
-
var _this = this;
|
|
32
30
|
_defineProperty(this, "id", void 0);
|
|
33
|
-
_defineProperty(this, "muteStatus", void 0);
|
|
34
31
|
_defineProperty(this, "appStateSubscription", void 0);
|
|
35
32
|
_defineProperty(this, "onPreviewDelegate", void 0);
|
|
36
33
|
_defineProperty(this, "onJoinDelegate", void 0);
|
|
@@ -107,7 +104,6 @@ class HMSSDK {
|
|
|
107
104
|
config,
|
|
108
105
|
id: this.id
|
|
109
106
|
});
|
|
110
|
-
this.addAppStateListener();
|
|
111
107
|
(0, _HMSPeersCache.setHmsPeersCache)(new _HMSPeersCache.HMSPeersCache(this.id));
|
|
112
108
|
(0, _HMSRoomCache.setHmsRoomCache)(new _HMSRoomCache.HMSRoomCache(this.id));
|
|
113
109
|
await _HMSManagerModule.default.join({
|
|
@@ -168,7 +164,6 @@ class HMSSDK {
|
|
|
168
164
|
}));
|
|
169
165
|
_defineProperty(this, "roomLeaveCleanup", () => {
|
|
170
166
|
var _this$appStateSubscri;
|
|
171
|
-
this.muteStatus = undefined;
|
|
172
167
|
this === null || this === void 0 || (_this$appStateSubscri = this.appStateSubscription) === null || _this$appStateSubscri === void 0 || _this$appStateSubscri.remove();
|
|
173
168
|
(0, _HMSPeersCache.clearHmsPeersCache)();
|
|
174
169
|
(0, _HMSRoomCache.clearHmsRoomCache)();
|
|
@@ -201,17 +196,16 @@ class HMSSDK {
|
|
|
201
196
|
* @param message the message that is to be sent
|
|
202
197
|
* @param type the default type is set to CHAT. You can pass a custom type here for sending events like Emoji Reactions, Notifications, etc
|
|
203
198
|
*/
|
|
204
|
-
_defineProperty(this, "sendBroadcastMessage", async
|
|
205
|
-
let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'chat';
|
|
199
|
+
_defineProperty(this, "sendBroadcastMessage", async (message, type = 'chat') => {
|
|
206
200
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function sendBroadcastMessage', {
|
|
207
201
|
message,
|
|
208
202
|
type: type || null,
|
|
209
|
-
id:
|
|
203
|
+
id: this.id
|
|
210
204
|
});
|
|
211
205
|
const data = await _HMSManagerModule.default.sendBroadcastMessage({
|
|
212
206
|
message,
|
|
213
207
|
type: type || null,
|
|
214
|
-
id:
|
|
208
|
+
id: this.id
|
|
215
209
|
});
|
|
216
210
|
return data;
|
|
217
211
|
});
|
|
@@ -223,18 +217,17 @@ class HMSSDK {
|
|
|
223
217
|
*
|
|
224
218
|
* @memberof HMSSDK
|
|
225
219
|
*/
|
|
226
|
-
_defineProperty(this, "sendGroupMessage", async
|
|
227
|
-
let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'chat';
|
|
220
|
+
_defineProperty(this, "sendGroupMessage", async (message, roles, type = 'chat') => {
|
|
228
221
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function sendGroupMessage', {
|
|
229
222
|
message,
|
|
230
223
|
roles,
|
|
231
|
-
id:
|
|
224
|
+
id: this.id,
|
|
232
225
|
type: type || null
|
|
233
226
|
});
|
|
234
227
|
const data = await _HMSManagerModule.default.sendGroupMessage({
|
|
235
228
|
message,
|
|
236
229
|
roles: _HMSHelper.HMSHelper.getRoleNames(roles),
|
|
237
|
-
id:
|
|
230
|
+
id: this.id,
|
|
238
231
|
type: type || null
|
|
239
232
|
});
|
|
240
233
|
return data;
|
|
@@ -247,18 +240,17 @@ class HMSSDK {
|
|
|
247
240
|
*
|
|
248
241
|
* @memberof HMSSDK
|
|
249
242
|
*/
|
|
250
|
-
_defineProperty(this, "sendDirectMessage", async
|
|
251
|
-
let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'chat';
|
|
243
|
+
_defineProperty(this, "sendDirectMessage", async (message, peer, type = 'chat') => {
|
|
252
244
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function sendDirectMessage', {
|
|
253
245
|
message,
|
|
254
246
|
peerId: peer.peerID,
|
|
255
|
-
id:
|
|
247
|
+
id: this.id,
|
|
256
248
|
type: type || null
|
|
257
249
|
});
|
|
258
250
|
const data = await _HMSManagerModule.default.sendDirectMessage({
|
|
259
251
|
message,
|
|
260
252
|
peerId: peer.peerID,
|
|
261
|
-
id:
|
|
253
|
+
id: this.id,
|
|
262
254
|
type: type || null
|
|
263
255
|
});
|
|
264
256
|
return data;
|
|
@@ -369,13 +361,12 @@ class HMSSDK {
|
|
|
369
361
|
*
|
|
370
362
|
* @memberof HMSSDK
|
|
371
363
|
*/
|
|
372
|
-
_defineProperty(this, "changeRole", async
|
|
373
|
-
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
364
|
+
_defineProperty(this, "changeRole", async (peer, role, force = false) => {
|
|
374
365
|
const data = {
|
|
375
366
|
peerId: peer === null || peer === void 0 ? void 0 : peer.peerID,
|
|
376
367
|
role: role === null || role === void 0 ? void 0 : role.name,
|
|
377
368
|
force: force,
|
|
378
|
-
id:
|
|
369
|
+
id: this.id
|
|
379
370
|
};
|
|
380
371
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function changeRole', data);
|
|
381
372
|
return await _HMSManagerModule.default.changeRole(data);
|
|
@@ -394,13 +385,12 @@ class HMSSDK {
|
|
|
394
385
|
*
|
|
395
386
|
* @memberof HMSSDK
|
|
396
387
|
*/
|
|
397
|
-
_defineProperty(this, "changeRoleOfPeer", async
|
|
398
|
-
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
388
|
+
_defineProperty(this, "changeRoleOfPeer", async (peer, role, force = false) => {
|
|
399
389
|
const data = {
|
|
400
390
|
peerId: peer.peerID,
|
|
401
391
|
role: role.name,
|
|
402
392
|
force: force,
|
|
403
|
-
id:
|
|
393
|
+
id: this.id
|
|
404
394
|
};
|
|
405
395
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function changeRoleOfPeer', data);
|
|
406
396
|
return _HMSManagerModule.default.changeRoleOfPeer(data);
|
|
@@ -508,17 +498,16 @@ class HMSSDK {
|
|
|
508
498
|
*
|
|
509
499
|
* @memberof HMSSDK
|
|
510
500
|
*/
|
|
511
|
-
_defineProperty(this, "endRoom", async
|
|
512
|
-
let lock = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
501
|
+
_defineProperty(this, "endRoom", async (reason, lock = false) => {
|
|
513
502
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function endRoom', {
|
|
514
503
|
lock,
|
|
515
504
|
reason,
|
|
516
|
-
id:
|
|
505
|
+
id: this.id
|
|
517
506
|
});
|
|
518
507
|
const data = {
|
|
519
508
|
lock,
|
|
520
509
|
reason,
|
|
521
|
-
id:
|
|
510
|
+
id: this.id
|
|
522
511
|
};
|
|
523
512
|
return await _HMSManagerModule.default.endRoom(data);
|
|
524
513
|
});
|
|
@@ -608,7 +597,6 @@ class HMSSDK {
|
|
|
608
597
|
mute,
|
|
609
598
|
id: this.id
|
|
610
599
|
});
|
|
611
|
-
this.muteStatus = mute;
|
|
612
600
|
_HMSManagerModule.default.setPlaybackForAllAudio({
|
|
613
601
|
mute,
|
|
614
602
|
id: this.id
|
|
@@ -718,31 +706,6 @@ class HMSSDK {
|
|
|
718
706
|
volume
|
|
719
707
|
});
|
|
720
708
|
});
|
|
721
|
-
_defineProperty(this, "resetVolume", () => {
|
|
722
|
-
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function resetVolume', {
|
|
723
|
-
id: this.id
|
|
724
|
-
});
|
|
725
|
-
if (_reactNative.Platform.OS === 'android') _HMSManagerModule.default.resetVolume({
|
|
726
|
-
id: this.id
|
|
727
|
-
});
|
|
728
|
-
});
|
|
729
|
-
/**
|
|
730
|
-
* - This is a temporary solution for the situation when mic access is taken from the app and
|
|
731
|
-
* user returns to the app with no mic access. It will re-acquire the mic by setting the volume
|
|
732
|
-
* from native side
|
|
733
|
-
*
|
|
734
|
-
* @memberof HMSSDK
|
|
735
|
-
*/
|
|
736
|
-
_defineProperty(this, "addAppStateListener", () => {
|
|
737
|
-
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function addAppStateListener', {
|
|
738
|
-
id: this.id
|
|
739
|
-
});
|
|
740
|
-
this.appStateSubscription = _reactNative.AppState.addEventListener('change', nextAppState => {
|
|
741
|
-
if (nextAppState === 'active' && _reactNative.Platform.OS === 'android') {
|
|
742
|
-
this.resetVolume();
|
|
743
|
-
}
|
|
744
|
-
});
|
|
745
|
-
});
|
|
746
709
|
/**
|
|
747
710
|
* - This function is used to start screenshare, currently available only for android
|
|
748
711
|
*
|
|
@@ -1884,9 +1847,6 @@ class HMSSDK {
|
|
|
1884
1847
|
(_getHmsPeersCache3 = (0, _HMSPeersCache.getHmsPeersCache)()) === null || _getHmsPeersCache3 === void 0 || _getHmsPeersCache3.updatePeerCache(data.peer.peerID, {
|
|
1885
1848
|
track
|
|
1886
1849
|
}, data.type);
|
|
1887
|
-
if (this.muteStatus && (data === null || data === void 0 ? void 0 : data.type) === 'TRACK_ADDED' && track.type === _HMSTrackType.HMSTrackType.AUDIO) {
|
|
1888
|
-
this.setPlaybackForAllAudio(this.muteStatus);
|
|
1889
|
-
}
|
|
1890
1850
|
if (this.onTrackDelegate) {
|
|
1891
1851
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Listener ON_TRACK_LISTENER_CALL', {
|
|
1892
1852
|
peer,
|