@100mslive/react-native-hms 1.9.1-beta.1 → 1.9.2
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/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +1 -2
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +0 -7
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +0 -20
- package/ios/HMSHLSPlayerManager.swift +4 -0
- package/lib/commonjs/classes/HMSCameraControl.js +1 -2
- package/lib/commonjs/classes/HMSCameraControl.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +16 -49
- package/lib/commonjs/classes/HMSSDK.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/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/module/classes/HMSCameraControl.js +1 -2
- package/lib/module/classes/HMSCameraControl.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +17 -50
- package/lib/module/classes/HMSSDK.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/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/typescript/classes/HMSSDK.d.ts +0 -9
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSSDK.tsx +1 -26
|
@@ -295,13 +295,12 @@ object HMSHelper {
|
|
|
295
295
|
if (data == null) {
|
|
296
296
|
return null
|
|
297
297
|
}
|
|
298
|
+
|
|
298
299
|
val builder = HMSAudioTrackSettings.Builder()
|
|
299
300
|
if (areAllRequiredKeysAvailable(data, arrayOf(Pair("useHardwareEchoCancellation", "Boolean")))
|
|
300
301
|
) {
|
|
301
302
|
val useHardwareEchoCancellation = data.getBoolean("useHardwareEchoCancellation")
|
|
302
303
|
builder.setUseHardwareAcousticEchoCanceler(useHardwareEchoCancellation)
|
|
303
|
-
} else {
|
|
304
|
-
builder.setUseHardwareAcousticEchoCanceler(false)
|
|
305
304
|
}
|
|
306
305
|
|
|
307
306
|
if (areAllRequiredKeysAvailable(data, arrayOf(Pair("initialState", "String")))) {
|
|
@@ -515,13 +515,6 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
515
515
|
hms?.stopHLSStreaming(callback)
|
|
516
516
|
}
|
|
517
517
|
|
|
518
|
-
@ReactMethod
|
|
519
|
-
fun resetVolume(data: ReadableMap) {
|
|
520
|
-
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
521
|
-
|
|
522
|
-
hms?.resetVolume()
|
|
523
|
-
}
|
|
524
|
-
|
|
525
518
|
@ReactMethod
|
|
526
519
|
fun changeName(
|
|
527
520
|
data: ReadableMap,
|
|
@@ -1558,26 +1558,6 @@ class HMSRNSDK(
|
|
|
1558
1558
|
)
|
|
1559
1559
|
}
|
|
1560
1560
|
|
|
1561
|
-
fun resetVolume() {
|
|
1562
|
-
val remotePeers = hmsSDK?.getRemotePeers()
|
|
1563
|
-
|
|
1564
|
-
if (remotePeers != null) {
|
|
1565
|
-
for (peer in remotePeers) {
|
|
1566
|
-
val playbackAllowed = peer.audioTrack?.isPlaybackAllowed
|
|
1567
|
-
if (playbackAllowed !== null && playbackAllowed) {
|
|
1568
|
-
peer.audioTrack?.setVolume(10.0)
|
|
1569
|
-
}
|
|
1570
|
-
val auxTracks = peer.auxiliaryTracks
|
|
1571
|
-
|
|
1572
|
-
for (track in auxTracks) {
|
|
1573
|
-
if (track.type === HMSTrackType.AUDIO) {
|
|
1574
|
-
(track as? HMSRemoteAudioTrack)?.setVolume(10.0)
|
|
1575
|
-
}
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
}
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
1561
|
fun changeName(
|
|
1582
1562
|
data: ReadableMap,
|
|
1583
1563
|
callback: Promise?,
|
|
@@ -191,6 +191,10 @@ class HMSHLSPlayer: UIView {
|
|
|
191
191
|
self.frame = frame
|
|
192
192
|
self.backgroundColor = UIColor(displayP3Red: 0, green: 0, blue: 0, alpha: 1)
|
|
193
193
|
|
|
194
|
+
if #available(iOS 15.0, *) {
|
|
195
|
+
hmsHLSPlayer._nativePlayer.audiovisualBackgroundPlaybackPolicy = .continuesIfPossible
|
|
196
|
+
}
|
|
197
|
+
|
|
194
198
|
// creating 100ms HLS Player and getting player view controller
|
|
195
199
|
let playerViewController = hmsHLSPlayer.videoPlayerViewController(showsPlayerControls: false)
|
|
196
200
|
hmsHLSPlayerViewController = playerViewController
|
|
@@ -14,8 +14,7 @@ class HMSCameraControl {
|
|
|
14
14
|
* @param {boolean} [flash=false] flash - value indicating whether to use flash while capturing image or not
|
|
15
15
|
* @returns Promise - which is resolved with the file path of the captured image saved on the disk
|
|
16
16
|
*/
|
|
17
|
-
static captureImageAtMaxSupportedResolution() {
|
|
18
|
-
let flash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
17
|
+
static captureImageAtMaxSupportedResolution(flash = false) {
|
|
19
18
|
return _HMSManagerModule.default.captureImageAtMaxSupportedResolution({
|
|
20
19
|
id: _HMSConstants.HMSConstants.DEFAULT_SDK_ID,
|
|
21
20
|
flash
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_HMSConstants","require","_HMSManagerModule","_interopRequireDefault","obj","__esModule","default","HMSCameraControl","captureImageAtMaxSupportedResolution","flash","
|
|
1
|
+
{"version":3,"names":["_HMSConstants","require","_HMSManagerModule","_interopRequireDefault","obj","__esModule","default","HMSCameraControl","captureImageAtMaxSupportedResolution","flash","HMSManager","id","HMSConstants","DEFAULT_SDK_ID","exports"],"sources":["HMSCameraControl.ts"],"sourcesContent":["import { HMSConstants } from './HMSConstants';\n\nimport HMSManager from './HMSManagerModule';\n\nexport class HMSCameraControl {\n /**\n * It captures the image from the device camera at max possible resolution.\n *\n * @param {boolean} [flash=false] flash - value indicating whether to use flash while capturing image or not\n * @returns Promise - which is resolved with the file path of the captured image saved on the disk\n */\n static captureImageAtMaxSupportedResolution(\n flash: boolean = false\n ): Promise<string> {\n return HMSManager.captureImageAtMaxSupportedResolution({\n id: HMSConstants.DEFAULT_SDK_ID,\n flash,\n });\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA4C,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAErC,MAAMG,gBAAgB,CAAC;EAC5B;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,oCAAoCA,CACzCC,KAAc,GAAG,KAAK,EACL;IACjB,OAAOC,yBAAU,CAACF,oCAAoC,CAAC;MACrDG,EAAE,EAAEC,0BAAY,CAACC,cAAc;MAC/BJ;IACF,CAAC,CAAC;EACJ;AACF;AAACK,OAAA,CAAAP,gBAAA,GAAAA,gBAAA"}
|
|
@@ -28,7 +28,6 @@ const ReactNativeVersion = require('react-native/Libraries/Core/ReactNativeVersi
|
|
|
28
28
|
let HmsSdk;
|
|
29
29
|
class HMSSDK {
|
|
30
30
|
constructor(id) {
|
|
31
|
-
var _this = this;
|
|
32
31
|
_defineProperty(this, "id", void 0);
|
|
33
32
|
_defineProperty(this, "muteStatus", void 0);
|
|
34
33
|
_defineProperty(this, "appStateSubscription", void 0);
|
|
@@ -107,7 +106,6 @@ class HMSSDK {
|
|
|
107
106
|
config,
|
|
108
107
|
id: this.id
|
|
109
108
|
});
|
|
110
|
-
this.addAppStateListener();
|
|
111
109
|
(0, _HMSPeersCache.setHmsPeersCache)(new _HMSPeersCache.HMSPeersCache(this.id));
|
|
112
110
|
(0, _HMSRoomCache.setHmsRoomCache)(new _HMSRoomCache.HMSRoomCache(this.id));
|
|
113
111
|
await _HMSManagerModule.default.join({
|
|
@@ -201,17 +199,16 @@ class HMSSDK {
|
|
|
201
199
|
* @param message the message that is to be sent
|
|
202
200
|
* @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
201
|
*/
|
|
204
|
-
_defineProperty(this, "sendBroadcastMessage", async
|
|
205
|
-
let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'chat';
|
|
202
|
+
_defineProperty(this, "sendBroadcastMessage", async (message, type = 'chat') => {
|
|
206
203
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function sendBroadcastMessage', {
|
|
207
204
|
message,
|
|
208
205
|
type: type || null,
|
|
209
|
-
id:
|
|
206
|
+
id: this.id
|
|
210
207
|
});
|
|
211
208
|
const data = await _HMSManagerModule.default.sendBroadcastMessage({
|
|
212
209
|
message,
|
|
213
210
|
type: type || null,
|
|
214
|
-
id:
|
|
211
|
+
id: this.id
|
|
215
212
|
});
|
|
216
213
|
return data;
|
|
217
214
|
});
|
|
@@ -223,18 +220,17 @@ class HMSSDK {
|
|
|
223
220
|
*
|
|
224
221
|
* @memberof HMSSDK
|
|
225
222
|
*/
|
|
226
|
-
_defineProperty(this, "sendGroupMessage", async
|
|
227
|
-
let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'chat';
|
|
223
|
+
_defineProperty(this, "sendGroupMessage", async (message, roles, type = 'chat') => {
|
|
228
224
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function sendGroupMessage', {
|
|
229
225
|
message,
|
|
230
226
|
roles,
|
|
231
|
-
id:
|
|
227
|
+
id: this.id,
|
|
232
228
|
type: type || null
|
|
233
229
|
});
|
|
234
230
|
const data = await _HMSManagerModule.default.sendGroupMessage({
|
|
235
231
|
message,
|
|
236
232
|
roles: _HMSHelper.HMSHelper.getRoleNames(roles),
|
|
237
|
-
id:
|
|
233
|
+
id: this.id,
|
|
238
234
|
type: type || null
|
|
239
235
|
});
|
|
240
236
|
return data;
|
|
@@ -247,18 +243,17 @@ class HMSSDK {
|
|
|
247
243
|
*
|
|
248
244
|
* @memberof HMSSDK
|
|
249
245
|
*/
|
|
250
|
-
_defineProperty(this, "sendDirectMessage", async
|
|
251
|
-
let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'chat';
|
|
246
|
+
_defineProperty(this, "sendDirectMessage", async (message, peer, type = 'chat') => {
|
|
252
247
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function sendDirectMessage', {
|
|
253
248
|
message,
|
|
254
249
|
peerId: peer.peerID,
|
|
255
|
-
id:
|
|
250
|
+
id: this.id,
|
|
256
251
|
type: type || null
|
|
257
252
|
});
|
|
258
253
|
const data = await _HMSManagerModule.default.sendDirectMessage({
|
|
259
254
|
message,
|
|
260
255
|
peerId: peer.peerID,
|
|
261
|
-
id:
|
|
256
|
+
id: this.id,
|
|
262
257
|
type: type || null
|
|
263
258
|
});
|
|
264
259
|
return data;
|
|
@@ -369,13 +364,12 @@ class HMSSDK {
|
|
|
369
364
|
*
|
|
370
365
|
* @memberof HMSSDK
|
|
371
366
|
*/
|
|
372
|
-
_defineProperty(this, "changeRole", async
|
|
373
|
-
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
367
|
+
_defineProperty(this, "changeRole", async (peer, role, force = false) => {
|
|
374
368
|
const data = {
|
|
375
369
|
peerId: peer === null || peer === void 0 ? void 0 : peer.peerID,
|
|
376
370
|
role: role === null || role === void 0 ? void 0 : role.name,
|
|
377
371
|
force: force,
|
|
378
|
-
id:
|
|
372
|
+
id: this.id
|
|
379
373
|
};
|
|
380
374
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function changeRole', data);
|
|
381
375
|
return await _HMSManagerModule.default.changeRole(data);
|
|
@@ -394,13 +388,12 @@ class HMSSDK {
|
|
|
394
388
|
*
|
|
395
389
|
* @memberof HMSSDK
|
|
396
390
|
*/
|
|
397
|
-
_defineProperty(this, "changeRoleOfPeer", async
|
|
398
|
-
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
391
|
+
_defineProperty(this, "changeRoleOfPeer", async (peer, role, force = false) => {
|
|
399
392
|
const data = {
|
|
400
393
|
peerId: peer.peerID,
|
|
401
394
|
role: role.name,
|
|
402
395
|
force: force,
|
|
403
|
-
id:
|
|
396
|
+
id: this.id
|
|
404
397
|
};
|
|
405
398
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function changeRoleOfPeer', data);
|
|
406
399
|
return _HMSManagerModule.default.changeRoleOfPeer(data);
|
|
@@ -508,17 +501,16 @@ class HMSSDK {
|
|
|
508
501
|
*
|
|
509
502
|
* @memberof HMSSDK
|
|
510
503
|
*/
|
|
511
|
-
_defineProperty(this, "endRoom", async
|
|
512
|
-
let lock = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
504
|
+
_defineProperty(this, "endRoom", async (reason, lock = false) => {
|
|
513
505
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function endRoom', {
|
|
514
506
|
lock,
|
|
515
507
|
reason,
|
|
516
|
-
id:
|
|
508
|
+
id: this.id
|
|
517
509
|
});
|
|
518
510
|
const data = {
|
|
519
511
|
lock,
|
|
520
512
|
reason,
|
|
521
|
-
id:
|
|
513
|
+
id: this.id
|
|
522
514
|
};
|
|
523
515
|
return await _HMSManagerModule.default.endRoom(data);
|
|
524
516
|
});
|
|
@@ -718,31 +710,6 @@ class HMSSDK {
|
|
|
718
710
|
volume
|
|
719
711
|
});
|
|
720
712
|
});
|
|
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
713
|
/**
|
|
747
714
|
* - This function is used to start screenshare, currently available only for android
|
|
748
715
|
*
|