@100mslive/react-native-hms 1.10.1 → 1.10.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/build.gradle +1 -0
- package/android/local.properties +1 -8
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +2 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +15 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +113 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +3 -0
- package/ios/HMSDecoder.swift +11 -0
- package/ios/HMSHelper.swift +64 -9
- package/ios/HMSManager.m +22 -0
- package/ios/HMSManager.swift +54 -4
- package/ios/HMSRNSDK.swift +75 -4
- package/lib/commonjs/classes/HMSAudioMixerSource.js +1 -1
- package/lib/commonjs/classes/HMSAudioNode.js +1 -1
- package/lib/commonjs/classes/HMSAudioNode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioSettings.js +1 -1
- package/lib/commonjs/classes/HMSAudioTrackSettings.js +10 -3
- package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSBrowserRecordingState.js +1 -1
- package/lib/commonjs/classes/HMSChangeTrackStateRequest.js +1 -1
- package/lib/commonjs/classes/HMSConfig.js +1 -1
- package/lib/commonjs/classes/HMSEncoder.js +1 -1
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSException.js +1 -1
- package/lib/commonjs/classes/HMSHLSConfig.js +1 -1
- package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js +1 -1
- package/lib/commonjs/classes/HMSHLSRecordingConfig.js +1 -1
- package/lib/commonjs/classes/HMSHLSRecordingState.js +1 -1
- package/lib/commonjs/classes/HMSHLSStreamingState.js +1 -1
- package/lib/commonjs/classes/HMSHLSVariant.js +1 -1
- package/lib/commonjs/classes/HMSInteractivityCenter.js +1 -1
- package/lib/commonjs/classes/HMSInteractivityCenter.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalAudioStats.js +1 -1
- package/lib/commonjs/classes/HMSLocalAudioTrack.js +1 -1
- package/lib/commonjs/classes/HMSLocalAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalPeer.js +1 -1
- package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalVideoStats.js +1 -1
- package/lib/commonjs/classes/HMSLocalVideoTrack.js +1 -1
- package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSLogSettings.js +1 -1
- package/lib/commonjs/classes/HMSLogger.js +1 -1
- package/lib/commonjs/classes/HMSLogger.js.map +1 -1
- package/lib/commonjs/classes/HMSMessage.js +1 -1
- package/lib/commonjs/classes/HMSMessageRecipient.js +1 -1
- package/lib/commonjs/classes/HMSNativeEventEmitter.js +1 -1
- package/lib/commonjs/classes/HMSNativeEventEmitter.js.map +1 -1
- package/lib/commonjs/classes/HMSNetworkQuality.js +1 -1
- package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js +127 -0
- package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js.map +1 -0
- package/lib/commonjs/classes/HMSPeer.js +17 -1
- package/lib/commonjs/classes/HMSPeer.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/HMSPeerType.js +13 -0
- package/lib/commonjs/classes/HMSPeerType.js.map +1 -0
- package/lib/commonjs/classes/HMSPeersCache.js +1 -1
- package/lib/commonjs/classes/HMSPeersCache.js.map +1 -1
- package/lib/commonjs/classes/HMSPermissions.js +1 -1
- package/lib/commonjs/classes/HMSPublishSettings.js +1 -1
- package/lib/commonjs/classes/HMSQualityLimitationReasons.js +1 -1
- package/lib/commonjs/classes/HMSRTCStats.js +1 -1
- package/lib/commonjs/classes/HMSRTCStatsReport.js +1 -1
- package/lib/commonjs/classes/HMSRTMPConfig.js +1 -1
- package/lib/commonjs/classes/HMSRemoteAudioStats.js +1 -1
- package/lib/commonjs/classes/HMSRemoteAudioTrack.js +1 -1
- package/lib/commonjs/classes/HMSRemoteAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRemotePeer.js +1 -1
- package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoStats.js +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoTrack.js +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRole.js +1 -1
- package/lib/commonjs/classes/HMSRoleChangeRequest.js +1 -1
- package/lib/commonjs/classes/HMSRoom.js +1 -1
- package/lib/commonjs/classes/HMSRoom.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/HMSRtmpStreamingState.js +1 -1
- package/lib/commonjs/classes/HMSRtmpVideoResolution.js +1 -1
- package/lib/commonjs/classes/HMSSDK.js +1 -1
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSServerRecordingState.js +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
- package/lib/commonjs/classes/HMSSimulcastLayerDefinition.js +1 -1
- package/lib/commonjs/classes/HMSSimulcastLayerSettings.js +1 -1
- package/lib/commonjs/classes/HMSSimulcastLayerSettingsPolicy.js +1 -1
- package/lib/commonjs/classes/HMSSimulcastSettings.js +1 -1
- package/lib/commonjs/classes/HMSSimulcastSettingsPolicy.js +1 -1
- package/lib/commonjs/classes/HMSSpeaker.js +1 -1
- package/lib/commonjs/classes/HMSSubscribeDegradationPolicy.js +1 -1
- package/lib/commonjs/classes/HMSSubscribeSettings.js +1 -1
- package/lib/commonjs/classes/HMSTrack.js +1 -1
- package/lib/commonjs/classes/HMSTrackSettings.js +1 -1
- package/lib/commonjs/classes/HMSVideoResolution.js +1 -1
- package/lib/commonjs/classes/HMSVideoSettings.js +1 -1
- package/lib/commonjs/classes/HMSVideoTrack.js +1 -1
- package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrackSettings.js +1 -1
- package/lib/commonjs/classes/HmsView.js +1 -1
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/hooks/useHMSPeerUpdates.js +1 -1
- package/lib/commonjs/hooks/useHMSPeerUpdates.js.map +1 -1
- package/lib/commonjs/index.js +24 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/emitter/EventEmitter.js +1 -1
- package/lib/commonjs/utils/emitter/EventEmitter.js.map +1 -1
- package/lib/commonjs/utils/emitter/_EmitterSubscription.js +1 -1
- package/lib/commonjs/utils/emitter/_EmitterSubscription.js.map +1 -1
- package/lib/commonjs/utils/emitter/_EventSubscription.js +1 -1
- package/lib/commonjs/utils/emitter/_EventSubscriptionVendor.js +1 -1
- package/lib/module/classes/HMSAudioMixerSource.js +1 -1
- package/lib/module/classes/HMSAudioNode.js +1 -1
- package/lib/module/classes/HMSAudioSettings.js +1 -1
- package/lib/module/classes/HMSAudioTrackSettings.js +10 -3
- package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSBrowserRecordingState.js +1 -1
- package/lib/module/classes/HMSChangeTrackStateRequest.js +1 -1
- package/lib/module/classes/HMSConfig.js +1 -1
- package/lib/module/classes/HMSEncoder.js +1 -1
- package/lib/module/classes/HMSException.js +1 -1
- package/lib/module/classes/HMSHLSConfig.js +1 -1
- package/lib/module/classes/HMSHLSMeetingURLVariant.js +1 -1
- package/lib/module/classes/HMSHLSRecordingConfig.js +1 -1
- package/lib/module/classes/HMSHLSRecordingState.js +1 -1
- package/lib/module/classes/HMSHLSStreamingState.js +1 -1
- package/lib/module/classes/HMSHLSVariant.js +1 -1
- package/lib/module/classes/HMSInteractivityCenter.js +1 -1
- package/lib/module/classes/HMSLocalAudioStats.js +1 -1
- package/lib/module/classes/HMSLocalAudioTrack.js +1 -1
- package/lib/module/classes/HMSLocalPeer.js +1 -1
- package/lib/module/classes/HMSLocalVideoStats.js +1 -1
- package/lib/module/classes/HMSLocalVideoTrack.js +1 -1
- package/lib/module/classes/HMSLogSettings.js +1 -1
- package/lib/module/classes/HMSLogger.js +1 -1
- package/lib/module/classes/HMSMessage.js +1 -1
- package/lib/module/classes/HMSMessageRecipient.js +1 -1
- package/lib/module/classes/HMSNativeEventEmitter.js +1 -1
- package/lib/module/classes/HMSNetworkQuality.js +1 -1
- package/lib/module/classes/HMSNoiseCancellationPlugin.js +121 -0
- package/lib/module/classes/HMSNoiseCancellationPlugin.js.map +1 -0
- package/lib/module/classes/HMSPeer.js +17 -1
- package/lib/module/classes/HMSPeer.js.map +1 -1
- package/lib/module/classes/HMSPeerListIterator.js +1 -1
- package/lib/module/classes/HMSPeerType.js +7 -0
- package/lib/module/classes/HMSPeerType.js.map +1 -0
- package/lib/module/classes/HMSPeersCache.js +1 -1
- package/lib/module/classes/HMSPeersCache.js.map +1 -1
- package/lib/module/classes/HMSPermissions.js +1 -1
- package/lib/module/classes/HMSPublishSettings.js +1 -1
- package/lib/module/classes/HMSQualityLimitationReasons.js +1 -1
- package/lib/module/classes/HMSRTCStats.js +1 -1
- package/lib/module/classes/HMSRTCStatsReport.js +1 -1
- package/lib/module/classes/HMSRTMPConfig.js +1 -1
- package/lib/module/classes/HMSRemoteAudioStats.js +1 -1
- package/lib/module/classes/HMSRemoteAudioTrack.js +1 -1
- package/lib/module/classes/HMSRemotePeer.js +1 -1
- package/lib/module/classes/HMSRemoteVideoStats.js +1 -1
- package/lib/module/classes/HMSRemoteVideoTrack.js +1 -1
- package/lib/module/classes/HMSRole.js +1 -1
- package/lib/module/classes/HMSRoleChangeRequest.js +1 -1
- package/lib/module/classes/HMSRoom.js +1 -1
- package/lib/module/classes/HMSRoomCache.js +1 -1
- package/lib/module/classes/HMSRtmpStreamingState.js +1 -1
- package/lib/module/classes/HMSRtmpVideoResolution.js +1 -1
- package/lib/module/classes/HMSSDK.js +1 -1
- package/lib/module/classes/HMSServerRecordingState.js +1 -1
- package/lib/module/classes/HMSSessionStore.js +1 -1
- package/lib/module/classes/HMSSimulcastLayerDefinition.js +1 -1
- package/lib/module/classes/HMSSimulcastLayerSettings.js +1 -1
- package/lib/module/classes/HMSSimulcastLayerSettingsPolicy.js +1 -1
- package/lib/module/classes/HMSSimulcastSettings.js +1 -1
- package/lib/module/classes/HMSSimulcastSettingsPolicy.js +1 -1
- package/lib/module/classes/HMSSpeaker.js +1 -1
- package/lib/module/classes/HMSSubscribeDegradationPolicy.js +1 -1
- package/lib/module/classes/HMSSubscribeSettings.js +1 -1
- package/lib/module/classes/HMSTrack.js +1 -1
- package/lib/module/classes/HMSTrackSettings.js +1 -1
- package/lib/module/classes/HMSVideoResolution.js +1 -1
- package/lib/module/classes/HMSVideoSettings.js +1 -1
- package/lib/module/classes/HMSVideoTrack.js +1 -1
- package/lib/module/classes/HMSVideoTrackSettings.js +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/emitter/EventEmitter.js +1 -1
- package/lib/module/utils/emitter/_EmitterSubscription.js +1 -1
- package/lib/module/utils/emitter/_EventSubscription.js +1 -1
- package/lib/module/utils/emitter/_EventSubscriptionVendor.js +1 -1
- package/lib/typescript/classes/HMSAudioTrackSettings.d.ts +9 -0
- package/lib/typescript/classes/HMSNoiseCancellationPlugin.d.ts +56 -0
- package/lib/typescript/classes/HMSPeer.d.ts +4 -0
- package/lib/typescript/classes/HMSPeerType.d.ts +5 -0
- package/lib/typescript/classes/HMSPeersCache.d.ts +2 -0
- package/lib/typescript/index.d.ts +2 -0
- package/package.json +6 -2
- package/react-native-hms.podspec +1 -0
- package/sdk-versions.json +3 -2
- package/src/classes/HMSAudioTrackSettings.ts +11 -0
- package/src/classes/HMSNoiseCancellationPlugin.ts +130 -0
- package/src/classes/HMSPeer.ts +26 -0
- package/src/classes/HMSPeerType.ts +9 -0
- package/src/classes/HMSPeersCache.ts +2 -0
- package/src/index.ts +2 -0
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/jatinnagar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
package/android/build.gradle
CHANGED
|
@@ -89,4 +89,5 @@ dependencies {
|
|
|
89
89
|
implementation "live.100ms:android-sdk:${sdkVersions["android"]}"
|
|
90
90
|
implementation "live.100ms:video-view:${sdkVersions["android"]}"
|
|
91
91
|
implementation "live.100ms:hls-player:${sdkVersions["android"]}"
|
|
92
|
+
implementation "live.100ms:hms-noise-cancellation-android:${sdkVersions["android"]}"
|
|
92
93
|
}
|
package/android/local.properties
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
# as it contains information specific to your local configuration.
|
|
3
|
-
#
|
|
4
|
-
# Location of the SDK. This is only used by Gradle.
|
|
5
|
-
# For customization when using a Version Control System, please read the
|
|
6
|
-
# header note.
|
|
7
|
-
#Mon Nov 14 20:51:00 IST 2022
|
|
8
|
-
sdk.dir=/Users/jatinnagar/Library/Android/sdk
|
|
1
|
+
sdk.dir=/Users/yogesh/Library/Android/sdk
|
|
@@ -318,6 +318,21 @@ object HMSHelper {
|
|
|
318
318
|
val initialState = getHMSTrackSettingsInitState(data.getString("initialState"))
|
|
319
319
|
builder.initialState(initialState)
|
|
320
320
|
}
|
|
321
|
+
|
|
322
|
+
if (areAllRequiredKeysAvailable(data, arrayOf(Pair("noiseCancellationPlugin", "Map")))) {
|
|
323
|
+
val plugin = data.getMap("noiseCancellationPlugin")
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* ***** Plugin Signature *****
|
|
327
|
+
* {
|
|
328
|
+
* modelName: "SMALL_FULL_BAND"
|
|
329
|
+
* initialState: "ENABLED" | "DISABLED"
|
|
330
|
+
* }
|
|
331
|
+
*/
|
|
332
|
+
val initialState = plugin?.getString("initialState") ?: "DISABLED"
|
|
333
|
+
builder.enableNoiseCancellation(initialState == "ENABLED")
|
|
334
|
+
}
|
|
335
|
+
|
|
321
336
|
return builder.build()
|
|
322
337
|
}
|
|
323
338
|
|
|
@@ -8,6 +8,7 @@ import android.content.pm.PackageManager
|
|
|
8
8
|
import android.content.res.Configuration
|
|
9
9
|
import android.os.Build
|
|
10
10
|
import android.os.Bundle
|
|
11
|
+
import android.util.Log
|
|
11
12
|
import android.util.Rational
|
|
12
13
|
import android.view.WindowManager
|
|
13
14
|
import androidx.annotation.RequiresApi
|
|
@@ -19,6 +20,7 @@ import com.facebook.react.module.annotations.ReactModule
|
|
|
19
20
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
20
21
|
import com.reactnativehmssdk.HMSManager.Companion.REACT_CLASS
|
|
21
22
|
import live.hms.video.error.HMSException
|
|
23
|
+
import live.hms.video.factories.noisecancellation.AvailabilityStatus
|
|
22
24
|
import java.util.UUID
|
|
23
25
|
|
|
24
26
|
@ReactModule(name = REACT_CLASS)
|
|
@@ -1456,6 +1458,117 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
1456
1458
|
}
|
|
1457
1459
|
// endregion
|
|
1458
1460
|
|
|
1461
|
+
// region Noise Cancellation Plugin
|
|
1462
|
+
@ReactMethod
|
|
1463
|
+
fun enableNoiseCancellationPlugin(
|
|
1464
|
+
data: ReadableMap,
|
|
1465
|
+
promise: Promise?,
|
|
1466
|
+
) {
|
|
1467
|
+
val rnSDK =
|
|
1468
|
+
HMSHelper.getHms(data, hmsCollection) ?: run {
|
|
1469
|
+
promise?.reject(
|
|
1470
|
+
"6004",
|
|
1471
|
+
"RN HMS SDK not initialized",
|
|
1472
|
+
)
|
|
1473
|
+
return
|
|
1474
|
+
}
|
|
1475
|
+
val hmsSdk =
|
|
1476
|
+
rnSDK.hmsSDK ?: run {
|
|
1477
|
+
promise?.reject(
|
|
1478
|
+
"6004",
|
|
1479
|
+
"HMS SDK not initialized",
|
|
1480
|
+
)
|
|
1481
|
+
return
|
|
1482
|
+
}
|
|
1483
|
+
hmsSdk.setNoiseCancellationEnabled(true)
|
|
1484
|
+
promise?.resolve(true)
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
@ReactMethod
|
|
1488
|
+
fun disableNoiseCancellationPlugin(
|
|
1489
|
+
data: ReadableMap,
|
|
1490
|
+
promise: Promise?,
|
|
1491
|
+
) {
|
|
1492
|
+
val rnSDK =
|
|
1493
|
+
HMSHelper.getHms(data, hmsCollection) ?: run {
|
|
1494
|
+
promise?.reject(
|
|
1495
|
+
"6004",
|
|
1496
|
+
"RN HMS SDK not initialized",
|
|
1497
|
+
)
|
|
1498
|
+
return
|
|
1499
|
+
}
|
|
1500
|
+
val hmsSdk =
|
|
1501
|
+
rnSDK.hmsSDK ?: run {
|
|
1502
|
+
promise?.reject(
|
|
1503
|
+
"6004",
|
|
1504
|
+
"HMS SDK not initialized",
|
|
1505
|
+
)
|
|
1506
|
+
return
|
|
1507
|
+
}
|
|
1508
|
+
hmsSdk.setNoiseCancellationEnabled(false)
|
|
1509
|
+
promise?.resolve(true)
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
@ReactMethod
|
|
1513
|
+
fun isNoiseCancellationPluginEnabled(
|
|
1514
|
+
data: ReadableMap,
|
|
1515
|
+
promise: Promise?,
|
|
1516
|
+
) {
|
|
1517
|
+
val rnSDK =
|
|
1518
|
+
HMSHelper.getHms(data, hmsCollection) ?: run {
|
|
1519
|
+
promise?.reject(
|
|
1520
|
+
"6004",
|
|
1521
|
+
"RN HMS SDK not initialized",
|
|
1522
|
+
)
|
|
1523
|
+
return
|
|
1524
|
+
}
|
|
1525
|
+
val hmsSdk =
|
|
1526
|
+
rnSDK.hmsSDK ?: run {
|
|
1527
|
+
promise?.reject(
|
|
1528
|
+
"6004",
|
|
1529
|
+
"HMS SDK not initialized",
|
|
1530
|
+
)
|
|
1531
|
+
return
|
|
1532
|
+
}
|
|
1533
|
+
val isEnabled = hmsSdk.getNoiseCancellationEnabled()
|
|
1534
|
+
promise?.resolve(isEnabled)
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
@ReactMethod
|
|
1538
|
+
fun isNoiseCancellationPluginAvailable(
|
|
1539
|
+
data: ReadableMap,
|
|
1540
|
+
promise: Promise?,
|
|
1541
|
+
) {
|
|
1542
|
+
val rnSDK =
|
|
1543
|
+
HMSHelper.getHms(data, hmsCollection) ?: run {
|
|
1544
|
+
promise?.reject(
|
|
1545
|
+
"6004",
|
|
1546
|
+
"RN HMS SDK not initialized",
|
|
1547
|
+
)
|
|
1548
|
+
return
|
|
1549
|
+
}
|
|
1550
|
+
val hmsSdk =
|
|
1551
|
+
rnSDK.hmsSDK ?: run {
|
|
1552
|
+
promise?.reject(
|
|
1553
|
+
"6004",
|
|
1554
|
+
"HMS SDK not initialized",
|
|
1555
|
+
)
|
|
1556
|
+
return
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
val availability: AvailabilityStatus = hmsSdk.isNoiseCancellationAvailable()
|
|
1560
|
+
val isAvailable =
|
|
1561
|
+
if (availability == AvailabilityStatus.Available) {
|
|
1562
|
+
true
|
|
1563
|
+
} else {
|
|
1564
|
+
val reason = (availability as AvailabilityStatus.NotAvailable).reason
|
|
1565
|
+
Log.d("HMSManager", "NoiseCancellation Not available because of $reason")
|
|
1566
|
+
false
|
|
1567
|
+
}
|
|
1568
|
+
promise?.resolve(isAvailable)
|
|
1569
|
+
}
|
|
1570
|
+
// endregion
|
|
1571
|
+
|
|
1459
1572
|
// region ActivityLifecycleCallbacks
|
|
1460
1573
|
|
|
1461
1574
|
override fun onActivityCreated(
|
|
@@ -1847,6 +1847,9 @@ class HMSRNSDK(
|
|
|
1847
1847
|
"isLocal" -> {
|
|
1848
1848
|
result.putBoolean("isLocal", peer.isLocal)
|
|
1849
1849
|
}
|
|
1850
|
+
"type" -> {
|
|
1851
|
+
result.putString("type", peer.type.name)
|
|
1852
|
+
}
|
|
1850
1853
|
"networkQuality" -> {
|
|
1851
1854
|
if (peer.networkQuality !== null) {
|
|
1852
1855
|
result.putMap("networkQuality", HMSDecoder.getHmsNetworkQuality(peer.networkQuality))
|
package/ios/HMSDecoder.swift
CHANGED
|
@@ -178,6 +178,8 @@ class HMSDecoder: NSObject {
|
|
|
178
178
|
}
|
|
179
179
|
data["isHandRaised"] = peer.isHandRaised
|
|
180
180
|
|
|
181
|
+
data["type"] = getPeerType(type: peer.type)
|
|
182
|
+
|
|
181
183
|
// joinedAt
|
|
182
184
|
|
|
183
185
|
data["role"] = getHmsRole(peer.role)
|
|
@@ -250,6 +252,15 @@ class HMSDecoder: NSObject {
|
|
|
250
252
|
return ["trackId": trackId, "source": source, "trackDescription": trackDescription, "isMute": isMute, "isDegraded": isDegraded, "type": kind, "kind": kind]
|
|
251
253
|
}
|
|
252
254
|
|
|
255
|
+
static func getPeerType(type: HMSPeerType) -> String {
|
|
256
|
+
switch type {
|
|
257
|
+
case .sip:
|
|
258
|
+
return "SIP"
|
|
259
|
+
default:
|
|
260
|
+
return "REGULAR"
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
253
264
|
static func getHmsLocalPeer(_ hmsLocalPeer: HMSLocalPeer?) -> [String: Any] {
|
|
254
265
|
|
|
255
266
|
guard let peer = hmsLocalPeer else { return [String: Any]() }
|
package/ios/HMSHelper.swift
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import HMSSDK
|
|
2
2
|
import Foundation
|
|
3
|
+
import HMSNoiseCancellationModels
|
|
3
4
|
|
|
4
5
|
class HMSHelper: NSObject {
|
|
5
6
|
static var audioMixerSourceHashMap: [String: HMSAudioNode]?
|
|
@@ -180,18 +181,18 @@ class HMSHelper: NSObject {
|
|
|
180
181
|
let initialState = settings?.value(forKey: "initialState") as? String
|
|
181
182
|
let initialStateEncoded = HMSHelper.getHMSTrackSettingsInitState(initialState)
|
|
182
183
|
let hmsTrackSettings = HMSVideoTrackSettings(codec: codec,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
184
|
+
resolution: resolution,
|
|
185
|
+
maxBitrate: maxBitrate,
|
|
186
|
+
maxFrameRate: maxFrameRate,
|
|
187
|
+
cameraFacing: cameraFacingEncoded,
|
|
188
|
+
simulcastSettings: nil,
|
|
189
|
+
trackDescription: trackDescription,
|
|
190
|
+
initialMuteState: initialStateEncoded,
|
|
191
|
+
videoPlugins: nil)
|
|
191
192
|
return hmsTrackSettings
|
|
192
193
|
}
|
|
193
194
|
|
|
194
|
-
static func getLocalAudioSettings(_ settings: NSDictionary?, _ hms: HMSSDK?, _ delegate: HMSManager?, _ id: String) -> HMSAudioTrackSettings? {
|
|
195
|
+
static func getLocalAudioSettings(_ settings: NSDictionary?, _ noiseCancellationPlugin: HMSNoiseCancellationPlugin?, _ hms: HMSSDK?, _ delegate: HMSManager?, _ id: String) -> HMSAudioTrackSettings? {
|
|
195
196
|
|
|
196
197
|
guard let settings = settings
|
|
197
198
|
else {
|
|
@@ -239,6 +240,10 @@ class HMSHelper: NSObject {
|
|
|
239
240
|
if let audioMode = audioMode {
|
|
240
241
|
builder.audioMode = audioMode
|
|
241
242
|
}
|
|
243
|
+
|
|
244
|
+
if let noiseCancellationPlugin = noiseCancellationPlugin {
|
|
245
|
+
builder.noiseCancellationPlugin = noiseCancellationPlugin
|
|
246
|
+
}
|
|
242
247
|
}
|
|
243
248
|
|
|
244
249
|
} catch {
|
|
@@ -255,7 +260,35 @@ class HMSHelper: NSObject {
|
|
|
255
260
|
if let audioMode = audioMode {
|
|
256
261
|
builder.audioMode = audioMode
|
|
257
262
|
}
|
|
263
|
+
|
|
264
|
+
if let noiseCancellationPlugin = noiseCancellationPlugin {
|
|
265
|
+
builder.noiseCancellationPlugin = noiseCancellationPlugin
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
static func getHMSNoiseCancellationPlugin(_ modelData: NSDictionary?) -> HMSNoiseCancellationPlugin? {
|
|
271
|
+
guard let modelData = modelData
|
|
272
|
+
else {
|
|
273
|
+
print(#function, "No Noise Cancellation Model data passed!")
|
|
274
|
+
return nil
|
|
275
|
+
}
|
|
276
|
+
guard let modeName = modelData.value(forKey: "modelName") as? String else {
|
|
277
|
+
print(#function, "Noise Cancellation Model Name not passed!")
|
|
278
|
+
return nil
|
|
279
|
+
}
|
|
280
|
+
guard let initState = modelData.value(forKey: "initialState") as? String else {
|
|
281
|
+
print(#function, "Noise Cancellation Model initialState not passed!")
|
|
282
|
+
return nil
|
|
258
283
|
}
|
|
284
|
+
|
|
285
|
+
if let pathForNCModel = HMSNoiseCancellationModels.path(for: getHMSNoiseCancellationModelName(modeName)) {
|
|
286
|
+
return HMSNoiseCancellationPlugin(modelPath: pathForNCModel,
|
|
287
|
+
initialState: getHMSNoiseCancellationInitialState(initState))
|
|
288
|
+
} else {
|
|
289
|
+
assertionFailure("noise cancellation model was not found")
|
|
290
|
+
}
|
|
291
|
+
return nil
|
|
259
292
|
}
|
|
260
293
|
|
|
261
294
|
static func getAudioMixerSourceMap() -> [String: HMSAudioNode]? {
|
|
@@ -272,6 +305,28 @@ class HMSHelper: NSObject {
|
|
|
272
305
|
return HMSVideoResolution.init(width: width, height: height)
|
|
273
306
|
}
|
|
274
307
|
|
|
308
|
+
static func getHMSNoiseCancellationModelName(_ modelNameString: String?) -> HMSNoiseCancellationModels.ModelName {
|
|
309
|
+
switch modelNameString {
|
|
310
|
+
case "SMALL_FULL_BAND":
|
|
311
|
+
return .smallFullBand
|
|
312
|
+
default:
|
|
313
|
+
print(#function, "Unknown Noise Cancellation Model name passed, using smallFullBand as default!")
|
|
314
|
+
return .smallFullBand
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
static func getHMSNoiseCancellationInitialState(_ initState: String?) -> HMSNoiseCancellationInitialState {
|
|
319
|
+
switch initState {
|
|
320
|
+
case "ENABLED":
|
|
321
|
+
return .enabled
|
|
322
|
+
case "DISABLED":
|
|
323
|
+
return .disabled
|
|
324
|
+
default:
|
|
325
|
+
print(#function, "Unknown Noise Cancellation Model initState passed, using Enabled as default!")
|
|
326
|
+
return .enabled
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
275
330
|
static func getVideoCodec(_ codecString: String?) -> HMSCodec {
|
|
276
331
|
switch codecString {
|
|
277
332
|
case "H264":
|
package/ios/HMSManager.m
CHANGED
|
@@ -331,4 +331,26 @@ RCT_EXTERN_METHOD(fetchLeaderboard
|
|
|
331
331
|
: (RCTPromiseResolveBlock)resolve
|
|
332
332
|
: (RCTPromiseRejectBlock)reject)
|
|
333
333
|
|
|
334
|
+
#pragma mark - Noise Cancellation Plugin
|
|
335
|
+
|
|
336
|
+
RCT_EXTERN_METHOD(enableNoiseCancellationPlugin
|
|
337
|
+
: (NSDictionary)data
|
|
338
|
+
: (RCTPromiseResolveBlock)resolve
|
|
339
|
+
: (RCTPromiseRejectBlock)reject)
|
|
340
|
+
|
|
341
|
+
RCT_EXTERN_METHOD(disableNoiseCancellationPlugin
|
|
342
|
+
: (NSDictionary)data
|
|
343
|
+
: (RCTPromiseResolveBlock)resolve
|
|
344
|
+
: (RCTPromiseRejectBlock)reject)
|
|
345
|
+
|
|
346
|
+
RCT_EXTERN_METHOD(isNoiseCancellationPluginEnabled
|
|
347
|
+
: (NSDictionary)data
|
|
348
|
+
: (RCTPromiseResolveBlock)resolve
|
|
349
|
+
: (RCTPromiseRejectBlock)reject)
|
|
350
|
+
|
|
351
|
+
RCT_EXTERN_METHOD(isNoiseCancellationPluginAvailable
|
|
352
|
+
: (NSDictionary)data
|
|
353
|
+
: (RCTPromiseResolveBlock)resolve
|
|
354
|
+
: (RCTPromiseRejectBlock)reject)
|
|
355
|
+
|
|
334
356
|
@end
|
package/ios/HMSManager.swift
CHANGED
|
@@ -190,7 +190,7 @@ class HMSManager: RCTEventEmitter {
|
|
|
190
190
|
|
|
191
191
|
hms?.setVolume(data, resolve, reject)
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
|
|
194
194
|
@objc
|
|
195
195
|
func switchAudioOutput(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
196
196
|
let hms = HMSHelper.getHms(data, hmsCollection)
|
|
@@ -218,16 +218,16 @@ class HMSManager: RCTEventEmitter {
|
|
|
218
218
|
resolve?(true)
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
|
|
221
|
+
|
|
222
222
|
@objc
|
|
223
223
|
func setAlwaysScreenOn(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
224
|
-
|
|
224
|
+
|
|
225
225
|
guard let enabled = data["enabled"] as? Bool else {
|
|
226
226
|
let errorMessage = "\(#function)" + HMSHelper.getUnavailableRequiredKey(data, ["enabled"])
|
|
227
227
|
reject?("6004", errorMessage, nil)
|
|
228
228
|
return
|
|
229
229
|
}
|
|
230
|
-
|
|
230
|
+
|
|
231
231
|
DispatchQueue.main.async {
|
|
232
232
|
UIApplication.shared.isIdleTimerDisabled = enabled
|
|
233
233
|
resolve?(nil)
|
|
@@ -712,4 +712,54 @@ class HMSManager: RCTEventEmitter {
|
|
|
712
712
|
}
|
|
713
713
|
interactivity.fetchLeaderboard(data, resolve, reject)
|
|
714
714
|
}
|
|
715
|
+
|
|
716
|
+
// MARK: - Noise Cancellation Plugin Functions
|
|
717
|
+
|
|
718
|
+
@objc
|
|
719
|
+
func enableNoiseCancellationPlugin( _ data: NSDictionary,
|
|
720
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
721
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
722
|
+
|
|
723
|
+
guard let rnsdk = HMSHelper.getHms(data, hmsCollection) else {
|
|
724
|
+
reject?("6004", "HMSRNSDK instance not found!", nil)
|
|
725
|
+
return
|
|
726
|
+
}
|
|
727
|
+
rnsdk.enableNoiseCancellationPlugin(data, resolve, reject)
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
@objc
|
|
731
|
+
func disableNoiseCancellationPlugin(_ data: NSDictionary,
|
|
732
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
733
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
734
|
+
|
|
735
|
+
guard let rnsdk = HMSHelper.getHms(data, hmsCollection) else {
|
|
736
|
+
reject?("6004", "HMSRNSDK instance not found!", nil)
|
|
737
|
+
return
|
|
738
|
+
}
|
|
739
|
+
rnsdk.disableNoiseCancellationPlugin(data, resolve, reject)
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
@objc
|
|
743
|
+
func isNoiseCancellationPluginEnabled(_ data: NSDictionary,
|
|
744
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
745
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
746
|
+
|
|
747
|
+
guard let rnsdk = HMSHelper.getHms(data, hmsCollection) else {
|
|
748
|
+
reject?("6004", "HMSRNSDK instance not found!", nil)
|
|
749
|
+
return
|
|
750
|
+
}
|
|
751
|
+
rnsdk.isNoiseCancellationPluginEnabled(data, resolve, reject)
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
@objc
|
|
755
|
+
func isNoiseCancellationPluginAvailable(_ data: NSDictionary,
|
|
756
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
757
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
758
|
+
|
|
759
|
+
guard let rnsdk = HMSHelper.getHms(data, hmsCollection) else {
|
|
760
|
+
reject?("6004", "HMSRNSDK instance not found!", nil)
|
|
761
|
+
return
|
|
762
|
+
}
|
|
763
|
+
rnsdk.isNoiseCancellationPluginAvailable(data, resolve, reject)
|
|
764
|
+
}
|
|
715
765
|
}
|
package/ios/HMSRNSDK.swift
CHANGED
|
@@ -32,6 +32,7 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
32
32
|
private var sessionStoreChangeObservers = [String: NSObjectProtocol]()
|
|
33
33
|
private var peerListIterators = [String: HMSPeerListIterator]()
|
|
34
34
|
private var roomMutedLocally = false
|
|
35
|
+
private var noiseCancellationPlugin: HMSNoiseCancellationPlugin?
|
|
35
36
|
|
|
36
37
|
// MARK: - Setup
|
|
37
38
|
init(data: NSDictionary?, delegate manager: HMSManager?, uid id: String) {
|
|
@@ -39,14 +40,20 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
39
40
|
self.delegate = manager
|
|
40
41
|
self.id = id
|
|
41
42
|
DispatchQueue.main.async { [weak self] in
|
|
43
|
+
var noiseCancellationPlugin: HMSNoiseCancellationPlugin?
|
|
44
|
+
|
|
42
45
|
self?.hms = HMSSDK.build { sdk in
|
|
43
46
|
sdk.appGroup = data?.value(forKey: "appGroup") as? String
|
|
44
47
|
sdk.frameworkInfo = HMSHelper.getFrameworkInfo(data?.value(forKey: "frameworkInfo") as? NSDictionary)
|
|
45
48
|
let trackSettings = data?.value(forKey: "trackSettings") as? NSDictionary
|
|
46
49
|
let videoSettings = HMSHelper.getLocalVideoSettings(trackSettings?.value(forKey: "video") as? NSDictionary)
|
|
47
|
-
let
|
|
50
|
+
let audioSettingsDict = trackSettings?.value(forKey: "audio") as? NSDictionary
|
|
51
|
+
let value = audioSettingsDict?.value(forKey: "noiseCancellationPlugin") as? NSDictionary
|
|
52
|
+
noiseCancellationPlugin = HMSHelper.getHMSNoiseCancellationPlugin(value)
|
|
53
|
+
let audioSettings = HMSHelper.getLocalAudioSettings(audioSettingsDict, noiseCancellationPlugin, sdk, self?.delegate, id)
|
|
48
54
|
sdk.trackSettings = HMSTrackSettings(videoSettings: videoSettings, audioSettings: audioSettings)
|
|
49
55
|
}
|
|
56
|
+
self?.noiseCancellationPlugin = noiseCancellationPlugin
|
|
50
57
|
if let hms = self?.hms {
|
|
51
58
|
self?.interactivity = HMSRNInteractivityCenter(
|
|
52
59
|
hmssdk: hms,
|
|
@@ -748,15 +755,15 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
748
755
|
}
|
|
749
756
|
}
|
|
750
757
|
}
|
|
751
|
-
|
|
758
|
+
|
|
752
759
|
func switchAudioOutput(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
753
|
-
|
|
760
|
+
|
|
754
761
|
guard let audioDevice = data["audioDevice"] as? String else {
|
|
755
762
|
let errorMessage = "\(#function)" + HMSHelper.getUnavailableRequiredKey(data, ["audioDevice"])
|
|
756
763
|
reject?("6004", errorMessage, nil)
|
|
757
764
|
return
|
|
758
765
|
}
|
|
759
|
-
|
|
766
|
+
|
|
760
767
|
DispatchQueue.main.async { [weak self] in
|
|
761
768
|
let outputDevice: HMSAudioOutputDevice
|
|
762
769
|
switch audioDevice {
|
|
@@ -1274,6 +1281,8 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1274
1281
|
return ["name": peer.name]
|
|
1275
1282
|
case "isLocal":
|
|
1276
1283
|
return ["isLocal": peer.isLocal]
|
|
1284
|
+
case "type":
|
|
1285
|
+
return ["type": HMSDecoder.getPeerType(type: peer.type)]
|
|
1277
1286
|
case "networkQuality":
|
|
1278
1287
|
if peer.networkQuality != nil {
|
|
1279
1288
|
return ["networkQuality": HMSDecoder.getHmsNetworkQuality(peer.networkQuality)]
|
|
@@ -2082,6 +2091,68 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
2082
2091
|
}
|
|
2083
2092
|
}
|
|
2084
2093
|
|
|
2094
|
+
// MARK: - Noise Cancellation Plugin Functions
|
|
2095
|
+
|
|
2096
|
+
func enableNoiseCancellationPlugin(_ data: NSDictionary,
|
|
2097
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2098
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2099
|
+
|
|
2100
|
+
guard let noiseCancellationPlugin = self.noiseCancellationPlugin else {
|
|
2101
|
+
let errorMessage = "\(#function) noiseCancellationPlugin instance is not available!"
|
|
2102
|
+
reject?("6004", errorMessage, nil)
|
|
2103
|
+
return
|
|
2104
|
+
}
|
|
2105
|
+
do {
|
|
2106
|
+
try noiseCancellationPlugin.enable()
|
|
2107
|
+
resolve?(true)
|
|
2108
|
+
} catch {
|
|
2109
|
+
reject?("6004", error.localizedDescription, nil)
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
func disableNoiseCancellationPlugin(_ data: NSDictionary,
|
|
2114
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2115
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2116
|
+
|
|
2117
|
+
guard let noiseCancellationPlugin = self.noiseCancellationPlugin else {
|
|
2118
|
+
let errorMessage = "\(#function) noiseCancellationPlugin instance is not available!"
|
|
2119
|
+
reject?("6004", errorMessage, nil)
|
|
2120
|
+
return
|
|
2121
|
+
}
|
|
2122
|
+
do {
|
|
2123
|
+
try noiseCancellationPlugin.disable()
|
|
2124
|
+
resolve?(true)
|
|
2125
|
+
} catch {
|
|
2126
|
+
reject?("6004", error.localizedDescription, nil)
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
func isNoiseCancellationPluginEnabled(_ data: NSDictionary,
|
|
2131
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2132
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2133
|
+
|
|
2134
|
+
guard let noiseCancellationPlugin = self.noiseCancellationPlugin else {
|
|
2135
|
+
let errorMessage = "\(#function) noiseCancellationPlugin instance is not available!"
|
|
2136
|
+
reject?("6004", errorMessage, nil)
|
|
2137
|
+
return
|
|
2138
|
+
}
|
|
2139
|
+
let isEnabled = noiseCancellationPlugin.isEnabled()
|
|
2140
|
+
resolve?(isEnabled)
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
func isNoiseCancellationPluginAvailable(_ data: NSDictionary,
|
|
2144
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2145
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2146
|
+
|
|
2147
|
+
guard let noiseCancellationPlugin = self.noiseCancellationPlugin else {
|
|
2148
|
+
let errorMessage = "\(#function) noiseCancellationPlugin instance is not available!"
|
|
2149
|
+
reject?("6004", errorMessage, nil)
|
|
2150
|
+
return
|
|
2151
|
+
}
|
|
2152
|
+
let isAvailable = noiseCancellationPlugin.isNoiseCancellationAvailable
|
|
2153
|
+
resolve?(isAvailable)
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2085
2156
|
// MARK: - Helper Functions
|
|
2086
2157
|
|
|
2087
2158
|
// Handle resetting states and data cleanup
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.HMSAudioMixerSource = void 0;
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
10
|
class HMSAudioMixerSource {
|
|
11
11
|
constructor(params) {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.HMSAudioNode = void 0;
|
|
7
7
|
var _HMSConstants = require("./HMSConstants");
|
|
8
8
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
10
10
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
11
|
class HMSAudioNode {
|
|
12
12
|
constructor(name) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_HMSConstants","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
|
1
|
+
{"version":3,"names":["_HMSConstants","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","HMSAudioNode","constructor","name","HMSConstants","DEFAULT_SDK_ID","toString","exports"],"sources":["HMSAudioNode.ts"],"sourcesContent":["import { HMSConstants } from './HMSConstants';\n\nexport class HMSAudioNode {\n name: string;\n sdkId: string = HMSConstants.DEFAULT_SDK_ID;\n\n constructor(name: string) {\n this.name = name;\n }\n\n toString(): string {\n return this.name;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAA8C,SAAAC,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AAEvC,MAAMW,YAAY,CAAC;EAIxBC,WAAWA,CAACC,IAAY,EAAE;IAAAvB,eAAA;IAAAA,eAAA,gBAFVwB,0BAAY,CAACC,cAAc;IAGzC,IAAI,CAACF,IAAI,GAAGA,IAAI;EAClB;EAEAG,QAAQA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACH,IAAI;EAClB;AACF;AAACI,OAAA,CAAAN,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.HMSAudioSettings = void 0;
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
10
|
class HMSAudioSettings {
|
|
11
11
|
constructor(params) {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.HMSAudioTrackSettings = void 0;
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
10
|
/**
|
|
11
11
|
* Customize local peer's Audio track settings before Joining the Room.
|
|
@@ -13,8 +13,6 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
13
13
|
* Checkout Track Settings docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings}
|
|
14
14
|
*/
|
|
15
15
|
class HMSAudioTrackSettings {
|
|
16
|
-
// ios only
|
|
17
|
-
|
|
18
16
|
constructor(params) {
|
|
19
17
|
_defineProperty(this, "initialState", void 0);
|
|
20
18
|
_defineProperty(this, "useHardwareEchoCancellation", void 0);
|
|
@@ -28,10 +26,19 @@ class HMSAudioTrackSettings {
|
|
|
28
26
|
* Checkout Music Mode docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/microphone/music-mode}
|
|
29
27
|
*/
|
|
30
28
|
_defineProperty(this, "audioMode", void 0);
|
|
29
|
+
// ios only
|
|
30
|
+
/**
|
|
31
|
+
* The noise cancellation plugin to use for the audio track.
|
|
32
|
+
* @type {HMSNoiseCancellationPlugin}
|
|
33
|
+
*
|
|
34
|
+
* Checkout Noise Cancellation docs for more details {@link https://www.100ms.live/docs/ios/v2/how-to-guides/extend-capabilities/plugins/noise-cancellation}
|
|
35
|
+
*/
|
|
36
|
+
_defineProperty(this, "noiseCancellationPlugin", void 0);
|
|
31
37
|
this.useHardwareEchoCancellation = params.useHardwareEchoCancellation;
|
|
32
38
|
this.initialState = params.initialState;
|
|
33
39
|
this.audioSource = params.audioSource;
|
|
34
40
|
this.audioMode = params.audioMode;
|
|
41
|
+
this.noiseCancellationPlugin = params.noiseCancellationPlugin;
|
|
35
42
|
}
|
|
36
43
|
}
|
|
37
44
|
exports.HMSAudioTrackSettings = HMSAudioTrackSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSAudioTrackSettings","constructor","params","_defineProperty","useHardwareEchoCancellation","initialState","audioSource","audioMode","exports"],"sources":["HMSAudioTrackSettings.ts"],"sourcesContent":["import type { HMSIOSAudioMode } from './HMSIOSAudioMode';\nimport type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';\n\n/**\n * Customize local peer's Audio track settings before Joining the Room.\n *\n * Checkout Track Settings docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings}\n */\nexport class HMSAudioTrackSettings {\n initialState?: HMSTrackSettingsInitState;\n useHardwareEchoCancellation?: boolean; // android only\n audioSource?: string[]; // ios only\n\n /**\n * [iOS only] `audioMode` allows you to capture audio in its highest quality\n * by disabling voice processing and increasing the maximum bandwidth limit\n *\n * Checkout Music Mode docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/microphone/music-mode}\n */\n audioMode?: HMSIOSAudioMode; // ios only\n\n constructor(params: {\n initialState?: HMSTrackSettingsInitState;\n useHardwareEchoCancellation?: boolean;\n audioSource?: string[];\n audioMode?: HMSIOSAudioMode;\n }) {\n this.useHardwareEchoCancellation = params.useHardwareEchoCancellation;\n this.initialState = params.initialState;\n this.audioSource = params.audioSource;\n this.audioMode = params.audioMode;\n }\n}\n"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"names":["HMSAudioTrackSettings","constructor","params","_defineProperty","useHardwareEchoCancellation","initialState","audioSource","audioMode","noiseCancellationPlugin","exports"],"sources":["HMSAudioTrackSettings.ts"],"sourcesContent":["import type { HMSIOSAudioMode } from './HMSIOSAudioMode';\nimport type { HMSNoiseCancellationPlugin } from './HMSNoiseCancellationPlugin';\nimport type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';\n\n/**\n * Customize local peer's Audio track settings before Joining the Room.\n *\n * Checkout Track Settings docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings}\n */\nexport class HMSAudioTrackSettings {\n initialState?: HMSTrackSettingsInitState;\n useHardwareEchoCancellation?: boolean; // android only\n audioSource?: string[]; // ios only\n\n /**\n * [iOS only] `audioMode` allows you to capture audio in its highest quality\n * by disabling voice processing and increasing the maximum bandwidth limit\n *\n * Checkout Music Mode docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/microphone/music-mode}\n */\n audioMode?: HMSIOSAudioMode; // ios only\n\n /**\n * The noise cancellation plugin to use for the audio track.\n * @type {HMSNoiseCancellationPlugin}\n *\n * Checkout Noise Cancellation docs for more details {@link https://www.100ms.live/docs/ios/v2/how-to-guides/extend-capabilities/plugins/noise-cancellation}\n */\n noiseCancellationPlugin?: HMSNoiseCancellationPlugin;\n\n constructor(params: {\n initialState?: HMSTrackSettingsInitState;\n useHardwareEchoCancellation?: boolean;\n audioSource?: string[];\n audioMode?: HMSIOSAudioMode;\n noiseCancellationPlugin?: HMSNoiseCancellationPlugin;\n }) {\n this.useHardwareEchoCancellation = params.useHardwareEchoCancellation;\n this.initialState = params.initialState;\n this.audioSource = params.audioSource;\n this.audioMode = params.audioMode;\n this.noiseCancellationPlugin = params.noiseCancellationPlugin;\n }\n}\n"],"mappings":";;;;;;;;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,qBAAqB,CAAC;EAqBjCC,WAAWA,CAACC,MAMX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAzBoC;IAAAA,eAAA;IACf;IAExB;AACF;AACA;AACA;AACA;AACA;IALEA,eAAA;IAM6B;IAE7B;AACF;AACA;AACA;AACA;AACA;IALEA,eAAA;IAeE,IAAI,CAACC,2BAA2B,GAAGF,MAAM,CAACE,2BAA2B;IACrE,IAAI,CAACC,YAAY,GAAGH,MAAM,CAACG,YAAY;IACvC,IAAI,CAACC,WAAW,GAAGJ,MAAM,CAACI,WAAW;IACrC,IAAI,CAACC,SAAS,GAAGL,MAAM,CAACK,SAAS;IACjC,IAAI,CAACC,uBAAuB,GAAGN,MAAM,CAACM,uBAAuB;EAC/D;AACF;AAACC,OAAA,CAAAT,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|