@100mslive/react-native-hms 1.10.7 → 1.10.9
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 +6 -5
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +47 -8
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +34 -3
- package/android/src/main/java/com/reactnativehmssdk/PipActionReceiver.kt +3 -1
- package/ios/HMSConstants.swift +1 -0
- package/ios/HMSManager.m +39 -0
- package/ios/HMSManager.swift +116 -1
- package/ios/HMSRNSDK.swift +276 -2
- package/ios/PIPMode/HMSPipModel.swift +18 -0
- package/ios/PIPMode/HMSPipView.swift +36 -0
- package/ios/PIPMode/HMSSampleBufferSwiftUIView.swift +45 -0
- package/lib/commonjs/classes/HMSAudioDevice.js +9 -0
- package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioMixingMode.js +11 -0
- package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioTrack.js +9 -0
- package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSCameraFacing.js +9 -0
- package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -1
- package/lib/commonjs/classes/HMSConfig.js +27 -0
- package/lib/commonjs/classes/HMSConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSException.js +18 -0
- package/lib/commonjs/classes/HMSException.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSTimedMetadata.js.map +1 -1
- package/lib/commonjs/classes/HMSIOSAudioMode.js +15 -0
- package/lib/commonjs/classes/HMSIOSAudioMode.js.map +1 -1
- package/lib/commonjs/classes/HMSLogAlarmManager.js +12 -0
- package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
- package/lib/commonjs/classes/HMSLogLevel.js +12 -0
- package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
- package/lib/commonjs/classes/HMSLogSettings.js +14 -0
- package/lib/commonjs/classes/HMSLogSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSNetworkQuality.js +11 -0
- package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -1
- package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js +40 -10
- package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js.map +1 -1
- package/lib/commonjs/classes/HMSPIPConfig.js +4 -0
- package/lib/commonjs/classes/HMSPIPConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSPIPListenerActions.js +9 -0
- package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSPeer.js +148 -0
- package/lib/commonjs/classes/HMSPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSPeerType.js +12 -1
- package/lib/commonjs/classes/HMSPeerType.js.map +1 -1
- package/lib/commonjs/classes/HMSRTMPConfig.js +14 -0
- package/lib/commonjs/classes/HMSRTMPConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSRole.js +17 -0
- package/lib/commonjs/classes/HMSRole.js.map +1 -1
- package/lib/commonjs/classes/HMSRtmpVideoResolution.js +13 -0
- package/lib/commonjs/classes/HMSRtmpVideoResolution.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +1153 -233
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js +14 -15
- package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
- package/lib/commonjs/classes/HMSTrack.js +13 -0
- package/lib/commonjs/classes/HMSTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSettings.js +10 -0
- package/lib/commonjs/classes/HMSTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSettingsInitState.js +9 -0
- package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSource.js +10 -0
- package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackType.js +7 -0
- package/lib/commonjs/classes/HMSTrackType.js.map +1 -1
- package/lib/commonjs/classes/HMSUpdateListenerActions.js +42 -3
- package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrack.js +17 -0
- package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrackSettings.js +12 -2
- package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +42 -0
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/module/classes/HMSAudioDevice.js +9 -0
- package/lib/module/classes/HMSAudioDevice.js.map +1 -1
- package/lib/module/classes/HMSAudioMixingMode.js +11 -0
- package/lib/module/classes/HMSAudioMixingMode.js.map +1 -1
- package/lib/module/classes/HMSAudioTrack.js +9 -0
- package/lib/module/classes/HMSAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSCameraFacing.js +9 -0
- package/lib/module/classes/HMSCameraFacing.js.map +1 -1
- package/lib/module/classes/HMSConfig.js +27 -0
- package/lib/module/classes/HMSConfig.js.map +1 -1
- package/lib/module/classes/HMSException.js +18 -0
- package/lib/module/classes/HMSException.js.map +1 -1
- package/lib/module/classes/HMSHLSTimedMetadata.js.map +1 -1
- package/lib/module/classes/HMSIOSAudioMode.js +15 -0
- package/lib/module/classes/HMSIOSAudioMode.js.map +1 -1
- package/lib/module/classes/HMSLogAlarmManager.js +12 -0
- package/lib/module/classes/HMSLogAlarmManager.js.map +1 -1
- package/lib/module/classes/HMSLogLevel.js +12 -0
- package/lib/module/classes/HMSLogLevel.js.map +1 -1
- package/lib/module/classes/HMSLogSettings.js +14 -0
- package/lib/module/classes/HMSLogSettings.js.map +1 -1
- package/lib/module/classes/HMSNetworkQuality.js +11 -0
- package/lib/module/classes/HMSNetworkQuality.js.map +1 -1
- package/lib/module/classes/HMSNoiseCancellationPlugin.js +40 -10
- package/lib/module/classes/HMSNoiseCancellationPlugin.js.map +1 -1
- package/lib/module/classes/HMSPIPConfig.js +1 -1
- package/lib/module/classes/HMSPIPConfig.js.map +1 -1
- package/lib/module/classes/HMSPIPListenerActions.js +9 -0
- package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
- package/lib/module/classes/HMSPeer.js +149 -0
- package/lib/module/classes/HMSPeer.js.map +1 -1
- package/lib/module/classes/HMSPeerType.js +12 -1
- package/lib/module/classes/HMSPeerType.js.map +1 -1
- package/lib/module/classes/HMSRTMPConfig.js +14 -0
- package/lib/module/classes/HMSRTMPConfig.js.map +1 -1
- package/lib/module/classes/HMSRole.js +17 -0
- package/lib/module/classes/HMSRole.js.map +1 -1
- package/lib/module/classes/HMSRtmpVideoResolution.js +13 -0
- package/lib/module/classes/HMSRtmpVideoResolution.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +1153 -233
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSSessionStore.js +14 -15
- package/lib/module/classes/HMSSessionStore.js.map +1 -1
- package/lib/module/classes/HMSTrack.js +13 -0
- package/lib/module/classes/HMSTrack.js.map +1 -1
- package/lib/module/classes/HMSTrackSettings.js +10 -0
- package/lib/module/classes/HMSTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSTrackSettingsInitState.js +9 -0
- package/lib/module/classes/HMSTrackSettingsInitState.js.map +1 -1
- package/lib/module/classes/HMSTrackSource.js +10 -0
- package/lib/module/classes/HMSTrackSource.js.map +1 -1
- package/lib/module/classes/HMSTrackType.js +7 -0
- package/lib/module/classes/HMSTrackType.js.map +1 -1
- package/lib/module/classes/HMSUpdateListenerActions.js +42 -3
- package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/module/classes/HMSVideoTrack.js +17 -0
- package/lib/module/classes/HMSVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSVideoTrackSettings.js +12 -2
- package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/module/classes/HmsView.js +43 -0
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/typescript/classes/HMSAudioDevice.d.ts +14 -0
- package/lib/typescript/classes/HMSAudioMixingMode.d.ts +11 -0
- package/lib/typescript/classes/HMSAudioTrack.d.ts +9 -0
- package/lib/typescript/classes/HMSCameraFacing.d.ts +11 -0
- package/lib/typescript/classes/HMSConfig.d.ts +27 -0
- package/lib/typescript/classes/HMSException.d.ts +18 -0
- package/lib/typescript/classes/HMSHLSTimedMetadata.d.ts +12 -0
- package/lib/typescript/classes/HMSIOSAudioMode.d.ts +15 -0
- package/lib/typescript/classes/HMSLogAlarmManager.d.ts +12 -0
- package/lib/typescript/classes/HMSLogLevel.d.ts +12 -0
- package/lib/typescript/classes/HMSLogSettings.d.ts +14 -0
- package/lib/typescript/classes/HMSNetworkQuality.d.ts +11 -0
- package/lib/typescript/classes/HMSNoiseCancellationPlugin.d.ts +36 -6
- package/lib/typescript/classes/HMSPIPConfig.d.ts +40 -0
- package/lib/typescript/classes/HMSPIPListenerActions.d.ts +17 -0
- package/lib/typescript/classes/HMSPeer.d.ts +137 -0
- package/lib/typescript/classes/HMSPeerType.d.ts +11 -0
- package/lib/typescript/classes/HMSRTMPConfig.d.ts +14 -0
- package/lib/typescript/classes/HMSRole.d.ts +17 -0
- package/lib/typescript/classes/HMSRtmpVideoResolution.d.ts +13 -0
- package/lib/typescript/classes/HMSSDK.d.ts +1083 -235
- package/lib/typescript/classes/HMSSessionStore.d.ts +14 -15
- package/lib/typescript/classes/HMSTrack.d.ts +13 -0
- package/lib/typescript/classes/HMSTrackSettings.d.ts +10 -0
- package/lib/typescript/classes/HMSTrackSettingsInitState.d.ts +11 -0
- package/lib/typescript/classes/HMSTrackSource.d.ts +10 -0
- package/lib/typescript/classes/HMSTrackType.d.ts +7 -0
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +290 -4
- package/lib/typescript/classes/HMSVideoTrack.d.ts +17 -0
- package/lib/typescript/classes/HMSVideoTrackSettings.d.ts +12 -2
- package/lib/typescript/classes/HmsView.d.ts +16 -0
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSAudioDevice.ts +18 -0
- package/src/classes/HMSAudioMixingMode.ts +11 -0
- package/src/classes/HMSAudioTrack.ts +9 -0
- package/src/classes/HMSCameraFacing.ts +11 -0
- package/src/classes/HMSConfig.ts +27 -0
- package/src/classes/HMSException.ts +18 -0
- package/src/classes/HMSHLSTimedMetadata.ts +12 -0
- package/src/classes/HMSIOSAudioMode.ts +15 -0
- package/src/classes/HMSLogAlarmManager.ts +12 -0
- package/src/classes/HMSLogLevel.ts +12 -0
- package/src/classes/HMSLogSettings.ts +14 -0
- package/src/classes/HMSNetworkQuality.ts +11 -0
- package/src/classes/HMSNoiseCancellationPlugin.ts +41 -10
- package/src/classes/HMSPIPConfig.ts +47 -0
- package/src/classes/HMSPIPListenerActions.ts +18 -0
- package/src/classes/HMSPeer.ts +137 -0
- package/src/classes/HMSPeerType.ts +13 -2
- package/src/classes/HMSRTMPConfig.ts +14 -0
- package/src/classes/HMSRole.ts +17 -0
- package/src/classes/HMSRtmpVideoResolution.ts +13 -0
- package/src/classes/HMSSDK.tsx +1211 -269
- package/src/classes/HMSSessionStore.ts +14 -15
- package/src/classes/HMSTrack.ts +13 -0
- package/src/classes/HMSTrackSettings.ts +10 -0
- package/src/classes/HMSTrackSettingsInitState.ts +11 -0
- package/src/classes/HMSTrackSource.ts +10 -0
- package/src/classes/HMSTrackType.ts +7 -0
- package/src/classes/HMSUpdateListenerActions.ts +312 -3
- package/src/classes/HMSVideoTrack.ts +17 -0
- package/src/classes/HMSVideoTrackSettings.ts +12 -2
- package/src/classes/HmsView.tsx +39 -0
|
@@ -4,6 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.HMSLogAlarmManager = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Enumeration for managing log alarm settings in HMS SDK for React Native applications. Android only.
|
|
9
|
+
*
|
|
10
|
+
* This enumeration defines constants used to configure the alarm manager for log files in the HMS SDK.
|
|
11
|
+
* It includes settings for the default directory size, default log file name, and maximum directory size,
|
|
12
|
+
* allowing for detailed control over how log files are managed and stored.
|
|
13
|
+
*
|
|
14
|
+
* @enum {string}
|
|
15
|
+
* @property {string} DEFAULT_DIR_SIZE - Represents the default size for the log directory.
|
|
16
|
+
* @property {string} DEFAULT_LOGS_FILE_NAME - Represents the default name for log files.
|
|
17
|
+
* @property {string} MAX_DIR_SIZE - Represents the maximum size for the log directory.
|
|
18
|
+
*/
|
|
7
19
|
let HMSLogAlarmManager = exports.HMSLogAlarmManager = /*#__PURE__*/function (HMSLogAlarmManager) {
|
|
8
20
|
HMSLogAlarmManager["DEFAULT_DIR_SIZE"] = "DEFAULT_DIR_SIZE";
|
|
9
21
|
HMSLogAlarmManager["DEFAULT_LOGS_FILE_NAME"] = "DEFAULT_LOGS_FILE_NAME";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSLogAlarmManager","exports"],"sources":["HMSLogAlarmManager.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["HMSLogAlarmManager","exports"],"sources":["HMSLogAlarmManager.ts"],"sourcesContent":["/**\n * Enumeration for managing log alarm settings in HMS SDK for React Native applications. Android only.\n *\n * This enumeration defines constants used to configure the alarm manager for log files in the HMS SDK.\n * It includes settings for the default directory size, default log file name, and maximum directory size,\n * allowing for detailed control over how log files are managed and stored.\n *\n * @enum {string}\n * @property {string} DEFAULT_DIR_SIZE - Represents the default size for the log directory.\n * @property {string} DEFAULT_LOGS_FILE_NAME - Represents the default name for log files.\n * @property {string} MAX_DIR_SIZE - Represents the maximum size for the log directory.\n */\nexport enum HMSLogAlarmManager {\n DEFAULT_DIR_SIZE = 'DEFAULT_DIR_SIZE',\n DEFAULT_LOGS_FILE_NAME = 'DEFAULT_LOGS_FILE_NAME',\n MAX_DIR_SIZE = 'MAX_DIR_SIZE',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXA,IAYYA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA","ignoreList":[]}
|
|
@@ -4,6 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.HMSLogLevel = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Enumeration for defining log levels in the HMS SDK for React Native applications.
|
|
9
|
+
*
|
|
10
|
+
* This enumeration provides a set of predefined log levels that can be used to control the verbosity of logging
|
|
11
|
+
* within the HMS SDK. It allows developers to specify how much detail they want in their logs, which can be
|
|
12
|
+
* helpful for debugging or monitoring the application's behavior.
|
|
13
|
+
*
|
|
14
|
+
* @enum {string}
|
|
15
|
+
* @property {string} VERBOSE - Represents the most verbose log level, including detailed debug information.
|
|
16
|
+
* @property {string} WARNING - Represents a log level for warning messages that might indicate potential issues.
|
|
17
|
+
* @property {string} ERROR - Represents a log level for error messages indicating failures that need attention.
|
|
18
|
+
*/
|
|
7
19
|
let HMSLogLevel = exports.HMSLogLevel = /*#__PURE__*/function (HMSLogLevel) {
|
|
8
20
|
HMSLogLevel["VERBOSE"] = "VERBOSE";
|
|
9
21
|
HMSLogLevel["WARNING"] = "WARNING";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSLogLevel","exports"],"sources":["HMSLogLevel.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["HMSLogLevel","exports"],"sources":["HMSLogLevel.ts"],"sourcesContent":["/**\n * Enumeration for defining log levels in the HMS SDK for React Native applications.\n *\n * This enumeration provides a set of predefined log levels that can be used to control the verbosity of logging\n * within the HMS SDK. It allows developers to specify how much detail they want in their logs, which can be\n * helpful for debugging or monitoring the application's behavior.\n *\n * @enum {string}\n * @property {string} VERBOSE - Represents the most verbose log level, including detailed debug information.\n * @property {string} WARNING - Represents a log level for warning messages that might indicate potential issues.\n * @property {string} ERROR - Represents a log level for error messages indicating failures that need attention.\n */\nexport enum HMSLogLevel {\n VERBOSE = 'VERBOSE',\n WARNING = 'WARNING',\n ERROR = 'ERROR',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXA,IAYYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA","ignoreList":[]}
|
|
@@ -7,6 +7,20 @@ exports.HMSLogSettings = void 0;
|
|
|
7
7
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
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
|
+
/**
|
|
11
|
+
* Represents the logging settings for the HMS SDK.
|
|
12
|
+
*
|
|
13
|
+
* This class encapsulates the settings related to logging within the HMS SDK, including the log level,
|
|
14
|
+
* whether log storage is enabled, and the maximum directory size for log storage.
|
|
15
|
+
* It is used to configure how logs are handled by the SDK, allowing for customization of log verbosity and storage requirements.
|
|
16
|
+
*
|
|
17
|
+
* @class HMSLogSettings
|
|
18
|
+
* @property {HMSLogLevel} level - The log level setting, determining the verbosity of the logs.
|
|
19
|
+
* @property {boolean} isLogStorageEnabled - Flag indicating whether log storage is enabled. Android only.
|
|
20
|
+
* @property {HMSLogAlarmManager} maxDirSizeInBytes - The maximum size of the log directory in bytes, managed by an instance of HMSLogAlarmManager. Android only.
|
|
21
|
+
*
|
|
22
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/debugging/logger
|
|
23
|
+
*/
|
|
10
24
|
class HMSLogSettings {
|
|
11
25
|
constructor(params) {
|
|
12
26
|
_defineProperty(this, "level", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSLogSettings","constructor","params","_defineProperty","level","isLogStorageEnabled","maxDirSizeInBytes","exports"],"sources":["HMSLogSettings.ts"],"sourcesContent":["import type { HMSLogAlarmManager } from './HMSLogAlarmManager';\nimport type { HMSLogLevel } from './HMSLogLevel';\n\nexport class HMSLogSettings {\n level: HMSLogLevel;\n isLogStorageEnabled: boolean;\n maxDirSizeInBytes: HMSLogAlarmManager;\n\n constructor(params: {\n level: HMSLogLevel;\n isLogStorageEnabled: boolean;\n maxDirSizeInBytes: HMSLogAlarmManager;\n }) {\n this.level = params.level;\n this.isLogStorageEnabled = params.isLogStorageEnabled;\n this.maxDirSizeInBytes = params.maxDirSizeInBytes;\n }\n}\n"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"names":["HMSLogSettings","constructor","params","_defineProperty","level","isLogStorageEnabled","maxDirSizeInBytes","exports"],"sources":["HMSLogSettings.ts"],"sourcesContent":["import type { HMSLogAlarmManager } from './HMSLogAlarmManager';\nimport type { HMSLogLevel } from './HMSLogLevel';\n\n/**\n * Represents the logging settings for the HMS SDK.\n *\n * This class encapsulates the settings related to logging within the HMS SDK, including the log level,\n * whether log storage is enabled, and the maximum directory size for log storage.\n * It is used to configure how logs are handled by the SDK, allowing for customization of log verbosity and storage requirements.\n *\n * @class HMSLogSettings\n * @property {HMSLogLevel} level - The log level setting, determining the verbosity of the logs.\n * @property {boolean} isLogStorageEnabled - Flag indicating whether log storage is enabled. Android only.\n * @property {HMSLogAlarmManager} maxDirSizeInBytes - The maximum size of the log directory in bytes, managed by an instance of HMSLogAlarmManager. Android only.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/debugging/logger\n */\nexport class HMSLogSettings {\n level: HMSLogLevel;\n isLogStorageEnabled: boolean;\n maxDirSizeInBytes: HMSLogAlarmManager;\n\n constructor(params: {\n level: HMSLogLevel;\n isLogStorageEnabled: boolean;\n maxDirSizeInBytes: HMSLogAlarmManager;\n }) {\n this.level = params.level;\n this.isLogStorageEnabled = params.isLogStorageEnabled;\n this.maxDirSizeInBytes = params.maxDirSizeInBytes;\n }\n}\n"],"mappings":";;;;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,CAAC;EAK1BC,WAAWA,CAACC,MAIX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACD,IAAI,CAACC,KAAK,GAAGF,MAAM,CAACE,KAAK;IACzB,IAAI,CAACC,mBAAmB,GAAGH,MAAM,CAACG,mBAAmB;IACrD,IAAI,CAACC,iBAAiB,GAAGJ,MAAM,CAACI,iBAAiB;EACnD;AACF;AAACC,OAAA,CAAAP,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -7,6 +7,17 @@ exports.HMSNetworkQuality = void 0;
|
|
|
7
7
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
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
|
+
/**
|
|
11
|
+
* Represents the network quality of a connection in the HMS (100ms) system.
|
|
12
|
+
*
|
|
13
|
+
* This class encapsulates the network quality information, specifically focusing on the downlink quality of the connection.
|
|
14
|
+
* The downlink quality is represented as a numerical value, providing a quantifiable measure of the receiving end's network performance.
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} params - The constructor parameters.
|
|
17
|
+
* @param {number} params.downlinkQuality - The downlink quality of the network connection.
|
|
18
|
+
*
|
|
19
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/network-quality
|
|
20
|
+
*/
|
|
10
21
|
class HMSNetworkQuality {
|
|
11
22
|
constructor(params) {
|
|
12
23
|
_defineProperty(this, "downlinkQuality", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSNetworkQuality","constructor","params","_defineProperty","downlinkQuality","exports"],"sources":["HMSNetworkQuality.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["HMSNetworkQuality","constructor","params","_defineProperty","downlinkQuality","exports"],"sources":["HMSNetworkQuality.ts"],"sourcesContent":["/**\n * Represents the network quality of a connection in the HMS (100ms) system.\n *\n * This class encapsulates the network quality information, specifically focusing on the downlink quality of the connection.\n * The downlink quality is represented as a numerical value, providing a quantifiable measure of the receiving end's network performance.\n *\n * @param {Object} params - The constructor parameters.\n * @param {number} params.downlinkQuality - The downlink quality of the network connection.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/network-quality\n */\nexport class HMSNetworkQuality {\n downlinkQuality: number;\n\n constructor(params: { downlinkQuality: number }) {\n this.downlinkQuality = params.downlinkQuality;\n }\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,iBAAiB,CAAC;EAG7BC,WAAWA,CAACC,MAAmC,EAAE;IAAAC,eAAA;IAC/C,IAAI,CAACC,eAAe,GAAGF,MAAM,CAACE,eAAe;EAC/C;AACF;AAACC,OAAA,CAAAL,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -12,18 +12,48 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
12
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
13
13
|
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); }
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* Represents the HMS Noise Cancellation Plugin.
|
|
16
|
+
* This class encapsulates the functionality for managing noise cancellation within a room, including enabling, disabling, and checking the availability and current state of noise cancellation.
|
|
17
|
+
*
|
|
18
|
+
* @property {HMSNoiseCancellationModels} modelName - Specifies the model of noise cancellation to be used.
|
|
19
|
+
* This property determines the algorithm and intensity of noise cancellation, allowing for customization
|
|
20
|
+
* based on the requirements of the room or application.
|
|
21
|
+
*
|
|
22
|
+
* @property {HMSNoiseCancellationInitialState} initialState - Defines the initial state of noise cancellation
|
|
23
|
+
* when the plugin is instantiated. This can be either enabled or disabled, providing control over the
|
|
24
|
+
* noise cancellation feature's activation upon initialization.
|
|
25
|
+
*
|
|
26
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/noise-cancellation
|
|
17
27
|
*/
|
|
18
28
|
class HMSNoiseCancellationPlugin {
|
|
19
29
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
30
|
+
* Constructs a new HMSNoiseCancellationPlugin instance with optional configuration settings.
|
|
31
|
+
* This constructor allows for the initialization of the plugin with specific noise cancellation
|
|
32
|
+
* model and initial state settings, providing flexibility in how noise cancellation is applied
|
|
33
|
+
* within the application.
|
|
34
|
+
*
|
|
35
|
+
* @param {Object} [config] - Optional configuration object for the plugin.
|
|
36
|
+
* @param {HMSNoiseCancellationModels} [config.modelName] - Specifies the noise cancellation model to be used.
|
|
37
|
+
* This determines the algorithm and intensity of noise cancellation. If not provided, a default
|
|
38
|
+
* model is used.
|
|
39
|
+
* @param {HMSNoiseCancellationInitialState} [config.initialState] - Sets the initial state of noise cancellation
|
|
40
|
+
* (enabled or disabled) when the plugin is instantiated. Defaults to disabled if not specified.
|
|
24
41
|
*/
|
|
25
42
|
constructor(config) {
|
|
43
|
+
/**
|
|
44
|
+
* The `modelName` property specifies the model of noise cancellation to be used within the HMS Noise Cancellation Plugin.
|
|
45
|
+
* This property determines the algorithm and intensity of noise cancellation, allowing for customization
|
|
46
|
+
* based on the specific requirements of the room or application. It is of type `HMSNoiseCancellationModels`,
|
|
47
|
+
* an enum that defines the available noise cancellation models.
|
|
48
|
+
*/
|
|
26
49
|
_defineProperty(this, "modelName", void 0);
|
|
50
|
+
/**
|
|
51
|
+
* Defines the initial state of noise cancellation when the plugin is instantiated.
|
|
52
|
+
* This property can be set to either `HMSNoiseCancellationInitialState.Enabled`
|
|
53
|
+
* or `HMSNoiseCancellationInitialState.Disabled`, determining whether noise cancellation should be active
|
|
54
|
+
* immediately upon the plugin's instantiation. This allows for control over the feature's initial activation state,
|
|
55
|
+
* catering to scenarios where noise cancellation needs to be either immediately available or manually activated later.
|
|
56
|
+
*/
|
|
27
57
|
_defineProperty(this, "initialState", void 0);
|
|
28
58
|
const data = {
|
|
29
59
|
modelName: HMSNoiseCancellationModels.SmallFullBand,
|
|
@@ -48,7 +78,7 @@ class HMSNoiseCancellationPlugin {
|
|
|
48
78
|
};
|
|
49
79
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable', data);
|
|
50
80
|
try {
|
|
51
|
-
return _HMSManagerModule.default.isNoiseCancellationPluginAvailable(data);
|
|
81
|
+
return await _HMSManagerModule.default.isNoiseCancellationPluginAvailable(data);
|
|
52
82
|
} catch (e) {
|
|
53
83
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.error('#Error in #Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable ', e);
|
|
54
84
|
return Promise.reject(e);
|
|
@@ -65,7 +95,7 @@ class HMSNoiseCancellationPlugin {
|
|
|
65
95
|
};
|
|
66
96
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function HMSNoiseCancellationPlugin#enable', data);
|
|
67
97
|
try {
|
|
68
|
-
return _HMSManagerModule.default.enableNoiseCancellationPlugin(data);
|
|
98
|
+
return await _HMSManagerModule.default.enableNoiseCancellationPlugin(data);
|
|
69
99
|
} catch (e) {
|
|
70
100
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.error('#Error in #Function HMSNoiseCancellationPlugin#enable ', e);
|
|
71
101
|
return Promise.reject(e);
|
|
@@ -82,7 +112,7 @@ class HMSNoiseCancellationPlugin {
|
|
|
82
112
|
};
|
|
83
113
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function HMSNoiseCancellationPlugin#disable', data);
|
|
84
114
|
try {
|
|
85
|
-
return _HMSManagerModule.default.disableNoiseCancellationPlugin(data);
|
|
115
|
+
return await _HMSManagerModule.default.disableNoiseCancellationPlugin(data);
|
|
86
116
|
} catch (e) {
|
|
87
117
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.error('#Error in #Function HMSNoiseCancellationPlugin#disable ', e);
|
|
88
118
|
return Promise.reject(e);
|
|
@@ -99,7 +129,7 @@ class HMSNoiseCancellationPlugin {
|
|
|
99
129
|
};
|
|
100
130
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function HMSNoiseCancellationPlugin#isEnabled', data);
|
|
101
131
|
try {
|
|
102
|
-
return _HMSManagerModule.default.isNoiseCancellationPluginEnabled(data);
|
|
132
|
+
return await _HMSManagerModule.default.isNoiseCancellationPluginEnabled(data);
|
|
103
133
|
} catch (e) {
|
|
104
134
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.error('#Error in #Function HMSNoiseCancellationPlugin#isEnabled ', e);
|
|
105
135
|
return Promise.reject(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_HMSManagerModule","_interopRequireDefault","require","_HMSConstants","_HMSLogger","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HMSNoiseCancellationPlugin","constructor","config","data","modelName","HMSNoiseCancellationModels","SmallFullBand","initialState","HMSNoiseCancellationInitialState","Disabled","isNoiseCancellationAvailable","id","HMSConstants","DEFAULT_SDK_ID","logger","verbose","HMSManagerModule","isNoiseCancellationPluginAvailable","error","Promise","reject","enable","enableNoiseCancellationPlugin","disable","disableNoiseCancellationPlugin","isEnabled","isNoiseCancellationPluginEnabled","exports"],"sources":["HMSNoiseCancellationPlugin.ts"],"sourcesContent":["import HMSManagerModule from '../modules/HMSManagerModule';\nimport { HMSConstants } from './HMSConstants';\nimport { logger } from './HMSLogger';\n\n/**\n * Class representing an HMS Noise Cancellation Plugin.\n * Checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/noise-cancellation} for more info\n */\nexport class HMSNoiseCancellationPlugin {\n modelName: HMSNoiseCancellationModels;\n initialState: HMSNoiseCancellationInitialState;\n\n /**\n * Creates an instance of HMSNoiseCancellationPlugin.\n * @param {Object} [config] - The configuration options.\n * @param {HMSNoiseCancellationModels} [config.modelName] - The model name for noise cancellation.\n * @param {HMSNoiseCancellationInitialState} [config.initialState] - The initial state for noise cancellation.\n */\n constructor(config?: {\n modelName: HMSNoiseCancellationModels;\n initialState: HMSNoiseCancellationInitialState;\n }) {\n const data = {\n modelName: HMSNoiseCancellationModels.SmallFullBand,\n initialState: HMSNoiseCancellationInitialState.Disabled,\n ...config,\n };\n this.modelName = data.modelName;\n this.initialState = data.initialState;\n }\n\n /**\n * To make noise cancellation work your room needs to have noise cancellation feature enabled.\n *\n * Gets whether noise cancellation is available for your room.\n * @returns {boolean} True if noise cancellation is available, false otherwise.\n *\n * Note: You can call this API to check the state of noise cancellation only after successfully joining the room.\n */\n async isNoiseCancellationAvailable(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose(\n '#Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable',\n data\n );\n\n try {\n return HMSManagerModule.isNoiseCancellationPluginAvailable(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable ',\n e\n );\n return Promise.reject(e);\n }\n }\n\n /**\n * Enables noise cancellation.\n * @returns {Promise<boolean>} A promise that resolves to true if noise cancellation is enabled, otherwise, rejected promise is returned\n */\n async enable(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose('#Function HMSNoiseCancellationPlugin#enable', data);\n\n try {\n return HMSManagerModule.enableNoiseCancellationPlugin(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#enable ',\n e\n );\n return Promise.reject(e);\n }\n }\n\n /**\n * Disables noise cancellation.\n * @returns {Promise<boolean>} A promise that resolves to true if noise cancellation is disabled, otherwise, rejected promise is returned\n */\n async disable(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose('#Function HMSNoiseCancellationPlugin#disable', data);\n\n try {\n return HMSManagerModule.disableNoiseCancellationPlugin(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#disable ',\n e\n );\n return Promise.reject(e);\n }\n }\n\n /**\n * Checks if noise cancellation is enabled.\n * @returns {boolean} true if noise cancellation is enabled, false otherwise.\n */\n async isEnabled(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose('#Function HMSNoiseCancellationPlugin#isEnabled', data);\n\n try {\n return HMSManagerModule.isNoiseCancellationPluginEnabled(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#isEnabled ',\n e\n );\n return Promise.reject(e);\n }\n }\n}\n\n/**\n * Enum for HMS Noise Cancellation Models.\n * @enum {String}\n */\nexport enum HMSNoiseCancellationModels {\n SmallFullBand = 'SMALL_FULL_BAND',\n}\n\n/**\n * Enum for HMS Noise Cancellation Initial State.\n * @enum {String}\n */\nexport enum HMSNoiseCancellationInitialState {\n Enabled = 'ENABLED',\n Disabled = 'DISABLED',\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAAqC,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAA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A,CAAAtB,0BAAA,0BAA1BA,0BAA0B;EAA1BA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA;AAItC;AACA;AACA;AACA;AAHA,IAIYG,gCAAgC,GAAAmB,OAAA,CAAAnB,gCAAA,0BAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAA,OAAhCA,gCAAgC;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_HMSManagerModule","_interopRequireDefault","require","_HMSConstants","_HMSLogger","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HMSNoiseCancellationPlugin","constructor","config","data","modelName","HMSNoiseCancellationModels","SmallFullBand","initialState","HMSNoiseCancellationInitialState","Disabled","isNoiseCancellationAvailable","id","HMSConstants","DEFAULT_SDK_ID","logger","verbose","HMSManagerModule","isNoiseCancellationPluginAvailable","error","Promise","reject","enable","enableNoiseCancellationPlugin","disable","disableNoiseCancellationPlugin","isEnabled","isNoiseCancellationPluginEnabled","exports"],"sources":["HMSNoiseCancellationPlugin.ts"],"sourcesContent":["import HMSManagerModule from '../modules/HMSManagerModule';\nimport { HMSConstants } from './HMSConstants';\nimport { logger } from './HMSLogger';\n\n/**\n * Represents the HMS Noise Cancellation Plugin.\n * This class encapsulates the functionality for managing noise cancellation within a room, including enabling, disabling, and checking the availability and current state of noise cancellation.\n *\n * @property {HMSNoiseCancellationModels} modelName - Specifies the model of noise cancellation to be used.\n * This property determines the algorithm and intensity of noise cancellation, allowing for customization\n * based on the requirements of the room or application.\n *\n * @property {HMSNoiseCancellationInitialState} initialState - Defines the initial state of noise cancellation\n * when the plugin is instantiated. This can be either enabled or disabled, providing control over the\n * noise cancellation feature's activation upon initialization.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/noise-cancellation\n */\nexport class HMSNoiseCancellationPlugin {\n /**\n * The `modelName` property specifies the model of noise cancellation to be used within the HMS Noise Cancellation Plugin.\n * This property determines the algorithm and intensity of noise cancellation, allowing for customization\n * based on the specific requirements of the room or application. It is of type `HMSNoiseCancellationModels`,\n * an enum that defines the available noise cancellation models.\n */\n modelName: HMSNoiseCancellationModels;\n\n /**\n * Defines the initial state of noise cancellation when the plugin is instantiated.\n * This property can be set to either `HMSNoiseCancellationInitialState.Enabled`\n * or `HMSNoiseCancellationInitialState.Disabled`, determining whether noise cancellation should be active\n * immediately upon the plugin's instantiation. This allows for control over the feature's initial activation state,\n * catering to scenarios where noise cancellation needs to be either immediately available or manually activated later.\n */\n initialState: HMSNoiseCancellationInitialState;\n\n /**\n * Constructs a new HMSNoiseCancellationPlugin instance with optional configuration settings.\n * This constructor allows for the initialization of the plugin with specific noise cancellation\n * model and initial state settings, providing flexibility in how noise cancellation is applied\n * within the application.\n *\n * @param {Object} [config] - Optional configuration object for the plugin.\n * @param {HMSNoiseCancellationModels} [config.modelName] - Specifies the noise cancellation model to be used.\n * This determines the algorithm and intensity of noise cancellation. If not provided, a default\n * model is used.\n * @param {HMSNoiseCancellationInitialState} [config.initialState] - Sets the initial state of noise cancellation\n * (enabled or disabled) when the plugin is instantiated. Defaults to disabled if not specified.\n */\n constructor(config?: {\n modelName: HMSNoiseCancellationModels;\n initialState: HMSNoiseCancellationInitialState;\n }) {\n const data = {\n modelName: HMSNoiseCancellationModels.SmallFullBand,\n initialState: HMSNoiseCancellationInitialState.Disabled,\n ...config,\n };\n this.modelName = data.modelName;\n this.initialState = data.initialState;\n }\n\n /**\n * To make noise cancellation work your room needs to have noise cancellation feature enabled.\n *\n * Gets whether noise cancellation is available for your room.\n * @returns {boolean} True if noise cancellation is available, false otherwise.\n *\n * Note: You can call this API to check the state of noise cancellation only after successfully joining the room.\n */\n async isNoiseCancellationAvailable(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose(\n '#Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable',\n data\n );\n\n try {\n return await HMSManagerModule.isNoiseCancellationPluginAvailable(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable ',\n e\n );\n return Promise.reject(e);\n }\n }\n\n /**\n * Enables noise cancellation.\n * @returns {Promise<boolean>} A promise that resolves to true if noise cancellation is enabled, otherwise, rejected promise is returned\n */\n async enable(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose('#Function HMSNoiseCancellationPlugin#enable', data);\n\n try {\n return await HMSManagerModule.enableNoiseCancellationPlugin(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#enable ',\n e\n );\n return Promise.reject(e);\n }\n }\n\n /**\n * Disables noise cancellation.\n * @returns {Promise<boolean>} A promise that resolves to true if noise cancellation is disabled, otherwise, rejected promise is returned\n */\n async disable(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose('#Function HMSNoiseCancellationPlugin#disable', data);\n\n try {\n return await HMSManagerModule.disableNoiseCancellationPlugin(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#disable ',\n e\n );\n return Promise.reject(e);\n }\n }\n\n /**\n * Checks if noise cancellation is enabled.\n * @returns {boolean} true if noise cancellation is enabled, false otherwise.\n */\n async isEnabled(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose('#Function HMSNoiseCancellationPlugin#isEnabled', data);\n\n try {\n return await HMSManagerModule.isNoiseCancellationPluginEnabled(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#isEnabled ',\n e\n );\n return Promise.reject(e);\n }\n }\n}\n\n/**\n * Enum for HMS Noise Cancellation Models.\n * @enum {String}\n */\nexport enum HMSNoiseCancellationModels {\n SmallFullBand = 'SMALL_FULL_BAND',\n}\n\n/**\n * Enum for HMS Noise Cancellation Initial State.\n * @enum {String}\n */\nexport enum HM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,CAAAnB,gCAAA,0BAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAA,OAAhCA,gCAAgC;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["HMSPIPConfig.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPIPConfig.ts"],"sourcesContent":["import type { HMSVideoViewMode } from './HMSVideoViewMode';\n\n/**\n * Configuration options for Picture-in-Picture (PIP) mode in a React Native application using HMS.\n *\n * This interface defines the settings available for customizing the PIP window that can appear when the app enters background mode.\n * It includes options for automatically entering PIP mode, adjusting the aspect ratio and scale type of the PIP window, and toggling\n * the visibility of various control buttons specific to Android or iOS platforms.\n *\n * @interface HMSPIPConfig\n * @property {boolean} [autoEnterPipMode] - Determines whether the app should automatically enter PIP mode when it goes into the background.\n * @property {[number, number]} [aspectRatio] - Sets the aspect ratio of the PIP window. Defaults are platform-specific: [16, 9] for Android and [9, 16] for iOS.\n * @property {HMSVideoViewMode} [scaleType] - Defines the scaling behavior of the video within the PIP window. Options are `ASPECT_FILL` (default), `ASPECT_FIT`, and `ASPECT_BALANCED`. Applies only to iOS.\n * @property {boolean} [useActiveSpeaker] - Whether the PIP window should automatically show the active speaker. Default is true. Applies only to iOS.\n * @property {boolean} [endButton] - Controls the visibility of the end call button within the PIP window. Default is true. Applies only to Android.\n * @property {boolean} [audioButton] - Controls the visibility of the audio mute/unmute button within the PIP window. Default is true. Applies only to Android.\n * @property {boolean} [videoButton] - Controls the visibility of the video mute/unmute button within the PIP window. Default is true. Applies only to Android.\n */\nexport interface HMSPIPConfig {\n /**\n * Whether to automatically enter PIP mode when app enters background.\n */\n autoEnterPipMode?: boolean;\n\n /**\n * The aspect ratio of the PIP window. Default is [16, 9] on Android & [9, 16] on iOS. Other values can be [3, 4], [1, 1], [4, 3], [16, 9].\n */\n aspectRatio?: [number, number];\n\n /**\n * The scale type of the PIP window. Default is ASPECT_FILL. Other values can be ASPECT_FIT, ASPECT_BALANCED. iOS Only.\n */\n scaleType?: HMSVideoViewMode;\n\n /**\n * Whether to show the Active Speaker in the PIP window. Default is true. iOS only.\n */\n useActiveSpeaker?: boolean;\n\n /**\n * Whether to show the end button in the PIP window. Default is true. Android only.\n */\n endButton?: boolean;\n\n /**\n * Whether to show the audio mute/unmute button in the PIP window. Default is true. Android only.\n */\n audioButton?: boolean;\n\n /**\n * Whether to show the video mute/unmute button in the PIP window. Default is true. Android only.\n */\n videoButton?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -4,6 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.HMSPIPListenerActions = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Enum for HMS Picture-in-Picture (PIP) Listener Actions.
|
|
9
|
+
*
|
|
10
|
+
* This enum defines the types of actions/events related to the Picture-in-Picture (PIP) mode that can be listened to
|
|
11
|
+
* within the HMS SDK. These actions allow the application to respond to changes in PIP mode or when the room is left
|
|
12
|
+
* while in PIP mode.
|
|
13
|
+
*
|
|
14
|
+
* @enum {string}
|
|
15
|
+
*/
|
|
7
16
|
let HMSPIPListenerActions = exports.HMSPIPListenerActions = /*#__PURE__*/function (HMSPIPListenerActions) {
|
|
8
17
|
HMSPIPListenerActions["ON_PIP_MODE_CHANGED"] = "ON_PIP_MODE_CHANGED";
|
|
9
18
|
HMSPIPListenerActions["ON_PIP_ROOM_LEAVE"] = "ON_PIP_ROOM_LEAVE";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSPIPListenerActions","exports"],"sources":["HMSPIPListenerActions.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["HMSPIPListenerActions","exports"],"sources":["HMSPIPListenerActions.ts"],"sourcesContent":["/**\n * Enum for HMS Picture-in-Picture (PIP) Listener Actions.\n *\n * This enum defines the types of actions/events related to the Picture-in-Picture (PIP) mode that can be listened to\n * within the HMS SDK. These actions allow the application to respond to changes in PIP mode or when the room is left\n * while in PIP mode.\n *\n * @enum {string}\n */\nexport enum HMSPIPListenerActions {\n /**\n * Action triggered when the Picture-in-Picture mode changes.\n * This can be used to handle UI changes or other logic when entering or exiting PIP mode.\n */\n ON_PIP_MODE_CHANGED = 'ON_PIP_MODE_CHANGED',\n\n /**\n * Action triggered when the room is left while in Picture-in-Picture mode. Android only.\n * This can be used to clean up resources or update the UI accordingly.\n */\n ON_PIP_ROOM_LEAVE = 'ON_PIP_ROOM_LEAVE',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IASYA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA","ignoreList":[]}
|
|
@@ -10,6 +10,22 @@ var _HMSPeerType = require("./HMSPeerType");
|
|
|
10
10
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
11
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
12
12
|
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); }
|
|
13
|
+
/**
|
|
14
|
+
* Represents a peer in the HMS ecosystem.
|
|
15
|
+
*
|
|
16
|
+
* This class encapsulates the properties and state of a peer within a session, including their ID, name, role, and various status flags.
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @class HMSPeer
|
|
20
|
+
* @property {string} peerID - The unique identifier for the peer.
|
|
21
|
+
* @property {string | undefined} _name - The name of the peer. Private access.
|
|
22
|
+
* @property {boolean | undefined} _isLocal - Flag indicating whether the peer is the local user. Private access.
|
|
23
|
+
* @property {string | undefined} _customerUserID - An optional custom user ID set by the application. Private access.
|
|
24
|
+
* @property {string | undefined} _metadata - Optional metadata associated with the peer. Private access.
|
|
25
|
+
* @property {HMSRole | undefined} _role - The role assigned to the peer within the session. Private access.
|
|
26
|
+
* @property {boolean} _isHandRaised - Flag indicating whether the peer has raised their hand. Defaults to false. Private access.
|
|
27
|
+
* @property {HMSPeerType} _type - The type of the peer, e.g., regular, screen share. Defaults to `HMSPeerType.REGULAR`. Private access.
|
|
28
|
+
*/
|
|
13
29
|
class HMSPeer {
|
|
14
30
|
_updateName(value) {
|
|
15
31
|
// If `_isLocal` is outdated, update it
|
|
@@ -65,6 +81,17 @@ class HMSPeer {
|
|
|
65
81
|
this.peerID = params.peerID;
|
|
66
82
|
this._name = params.name;
|
|
67
83
|
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Gets the name of the peer.
|
|
87
|
+
*
|
|
88
|
+
* This getter method retrieves the name of the peer. If the name has already been set locally, it returns that value.
|
|
89
|
+
* Otherwise, it attempts to retrieve the name from the HMS peers cache. If the cache does not contain the name,
|
|
90
|
+
* it falls back to fetching the name directly from the native layer using the peer's ID.
|
|
91
|
+
* Once a value is retrieved, it updates the local `_name` property to ensure consistency.
|
|
92
|
+
*
|
|
93
|
+
* @returns {string | undefined} The name of the peer if available, otherwise `undefined`.
|
|
94
|
+
*/
|
|
68
95
|
get name() {
|
|
69
96
|
if (this._name) {
|
|
70
97
|
return this._name;
|
|
@@ -76,6 +103,16 @@ class HMSPeer {
|
|
|
76
103
|
}
|
|
77
104
|
return value ?? this._name;
|
|
78
105
|
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Determines if the peer is the local user.
|
|
109
|
+
*
|
|
110
|
+
* This getter method checks if the peer is the local user by first attempting to retrieve the 'isLocal' property value from the HMS peers cache.
|
|
111
|
+
* If the value is not found in the cache, it falls back to fetching the property directly from the native layer using the peer's ID.
|
|
112
|
+
* Once a value is retrieved, it updates the local `_isLocal` property to ensure the value is current.
|
|
113
|
+
*
|
|
114
|
+
* @returns {boolean | undefined} True if the peer is the local user, false otherwise. Returns `undefined` if the information is not available.
|
|
115
|
+
*/
|
|
79
116
|
get isLocal() {
|
|
80
117
|
const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
|
|
81
118
|
const value = hmsPeersCache ? hmsPeersCache.getProperty(this.peerID, 'isLocal') : (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'isLocal');
|
|
@@ -84,6 +121,19 @@ class HMSPeer {
|
|
|
84
121
|
}
|
|
85
122
|
return value ?? this._isLocal;
|
|
86
123
|
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Checks if the peer has raised their hand.
|
|
127
|
+
*
|
|
128
|
+
* This getter method determines whether the peer has their hand raised in the session. It first attempts to retrieve the 'isHandRaised' property value
|
|
129
|
+
* from the HMS peers cache. If the value is not found in the cache, it falls back to fetching the property directly from the native layer using the peer's ID.
|
|
130
|
+
* Once a value is retrieved, it updates the local `_isHandRaised` property to ensure the value is current and consistent.
|
|
131
|
+
*
|
|
132
|
+
* @returns {boolean} True if the peer has their hand raised, false otherwise. Defaults to false if the information is not available.
|
|
133
|
+
*
|
|
134
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/large-room
|
|
135
|
+
*
|
|
136
|
+
*/
|
|
87
137
|
get isHandRaised() {
|
|
88
138
|
const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
|
|
89
139
|
const value = hmsPeersCache ? hmsPeersCache.getProperty(this.peerID, 'isHandRaised') : (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'isHandRaised');
|
|
@@ -92,6 +142,19 @@ class HMSPeer {
|
|
|
92
142
|
}
|
|
93
143
|
return value ?? this._isHandRaised;
|
|
94
144
|
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Retrieves the network quality of the peer.
|
|
148
|
+
*
|
|
149
|
+
* This getter method attempts to obtain the network quality of the peer, which is an indicator of the current network conditions affecting the peer's connection.
|
|
150
|
+
* It first tries to get this information from the HMS peers cache. If the information is not available in the cache,
|
|
151
|
+
* it falls back to fetching the network quality directly from the native layer using the peer's ID.
|
|
152
|
+
* The network quality is represented by the `HMSNetworkQuality` type, which may include values such as 'good', 'poor', etc., depending on the implementation.
|
|
153
|
+
*
|
|
154
|
+
* @returns {HMSNetworkQuality | undefined} The network quality of the peer if available, otherwise `undefined`.
|
|
155
|
+
*
|
|
156
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/network-quality
|
|
157
|
+
*/
|
|
95
158
|
get networkQuality() {
|
|
96
159
|
const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
|
|
97
160
|
if (hmsPeersCache) {
|
|
@@ -99,6 +162,17 @@ class HMSPeer {
|
|
|
99
162
|
}
|
|
100
163
|
return (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'networkQuality');
|
|
101
164
|
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Retrieves the custom user ID of the peer.
|
|
168
|
+
*
|
|
169
|
+
* This getter method attempts to obtain the custom user ID of the peer, which is an optional identifier that can be set by the application.
|
|
170
|
+
* It first tries to get this information from the HMS peers cache. If the information is not available in the cache,
|
|
171
|
+
* it falls back to fetching the custom user ID directly from the native layer using the peer's ID.
|
|
172
|
+
* Once a value is retrieved, it updates the local `_customerUserID` property to ensure the value is current and consistent.
|
|
173
|
+
*
|
|
174
|
+
* @returns {string | undefined} The custom user ID of the peer if available, otherwise `undefined`.
|
|
175
|
+
*/
|
|
102
176
|
get customerUserID() {
|
|
103
177
|
const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
|
|
104
178
|
const value = hmsPeersCache ? hmsPeersCache.getProperty(this.peerID, 'customerUserID') : (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'customerUserID');
|
|
@@ -107,6 +181,19 @@ class HMSPeer {
|
|
|
107
181
|
}
|
|
108
182
|
return value ?? this._customerUserID;
|
|
109
183
|
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Retrieves the metadata associated with the peer.
|
|
187
|
+
*
|
|
188
|
+
* This getter method attempts to obtain the metadata of the peer, which can include any additional information set by the application.
|
|
189
|
+
* It first tries to get this information from the HMS peers cache. If the information is not available in the cache,
|
|
190
|
+
* it falls back to fetching the metadata directly from the native layer using the peer's ID.
|
|
191
|
+
* Once a value is retrieved, it updates the local `_metadata` property to ensure the value is current and consistent.
|
|
192
|
+
*
|
|
193
|
+
* @returns {string | undefined} The metadata of the peer if available, otherwise `undefined`.
|
|
194
|
+
*
|
|
195
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-metadata
|
|
196
|
+
*/
|
|
110
197
|
get metadata() {
|
|
111
198
|
const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
|
|
112
199
|
const value = hmsPeersCache ? hmsPeersCache.getProperty(this.peerID, 'metadata') : (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'metadata');
|
|
@@ -115,6 +202,19 @@ class HMSPeer {
|
|
|
115
202
|
}
|
|
116
203
|
return value ?? this._metadata;
|
|
117
204
|
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Retrieves the role of the peer.
|
|
208
|
+
*
|
|
209
|
+
* This getter method attempts to obtain the role assigned to the peer within the session. The role can define permissions and capabilities
|
|
210
|
+
* within the session context. It first tries to get this information from the HMS peers cache. If the role information is not available in the cache,
|
|
211
|
+
* it falls back to fetching the role directly from the native layer using the peer's ID. Once a value is retrieved, it updates the local `_role`
|
|
212
|
+
* property to ensure the value is current and consistent.
|
|
213
|
+
*
|
|
214
|
+
* @returns {HMSRole | undefined} The role of the peer if available, otherwise `undefined`.
|
|
215
|
+
*
|
|
216
|
+
* @see https://www.100ms.live/docs/get-started/v2/get-started/concepts/templates-and-roles
|
|
217
|
+
*/
|
|
118
218
|
get role() {
|
|
119
219
|
const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
|
|
120
220
|
const value = hmsPeersCache ? hmsPeersCache.getProperty(this.peerID, 'role') : (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'role');
|
|
@@ -123,6 +223,16 @@ class HMSPeer {
|
|
|
123
223
|
}
|
|
124
224
|
return value ?? this._role;
|
|
125
225
|
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Retrieves the audio track associated with the peer.
|
|
229
|
+
*
|
|
230
|
+
* This getter method attempts to obtain the audio track of the peer. It first tries to get this information from the HMS peers cache.
|
|
231
|
+
* If the audio track information is not available in the cache, it falls back to fetching the audio track directly from the native layer using the peer's ID.
|
|
232
|
+
* This allows for real-time access to the peer's audio track, which can be used for various audio-related functionalities within the application.
|
|
233
|
+
*
|
|
234
|
+
* @returns {HMSAudioTrack | undefined} The audio track of the peer if available, otherwise `undefined`.
|
|
235
|
+
*/
|
|
126
236
|
get audioTrack() {
|
|
127
237
|
const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
|
|
128
238
|
if (hmsPeersCache) {
|
|
@@ -130,6 +240,17 @@ class HMSPeer {
|
|
|
130
240
|
}
|
|
131
241
|
return (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'audioTrack');
|
|
132
242
|
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Retrieves the video track associated with the peer.
|
|
246
|
+
*
|
|
247
|
+
* This getter method attempts to obtain the video track of the peer. It first tries to get this information from the HMS peers cache.
|
|
248
|
+
* If the video track information is not available in the cache, it falls back to fetching the video track directly from the native layer using the peer's ID.
|
|
249
|
+
* This allows for real-time access to the peer's video track, which can be used for various video-related functionalities within the application.
|
|
250
|
+
*
|
|
251
|
+
* @returns {HMSVideoTrack | undefined} The video track of the peer if available, otherwise `undefined`.
|
|
252
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview
|
|
253
|
+
*/
|
|
133
254
|
get videoTrack() {
|
|
134
255
|
const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
|
|
135
256
|
if (hmsPeersCache) {
|
|
@@ -137,6 +258,19 @@ class HMSPeer {
|
|
|
137
258
|
}
|
|
138
259
|
return (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'videoTrack');
|
|
139
260
|
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Retrieves the auxiliary tracks associated with the peer.
|
|
264
|
+
*
|
|
265
|
+
* This getter method attempts to obtain the auxiliary tracks of the peer, which can include tracks like screen shares or additional media streams.
|
|
266
|
+
* It first tries to get this information from the HMS peers cache. If the auxiliary track information is not available in the cache,
|
|
267
|
+
* it falls back to fetching the auxiliary tracks directly from the native layer using the peer's ID.
|
|
268
|
+
* This allows for real-time access to the peer's auxiliary tracks, which can be used for various functionalities within the application,
|
|
269
|
+
* such as displaying a screen share or additional video feeds.
|
|
270
|
+
*
|
|
271
|
+
* @returns {HMSTrack[] | undefined} The auxiliary tracks of the peer if available, otherwise `undefined`.
|
|
272
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/screenshare
|
|
273
|
+
*/
|
|
140
274
|
get auxiliaryTracks() {
|
|
141
275
|
const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
|
|
142
276
|
if (hmsPeersCache) {
|
|
@@ -144,6 +278,20 @@ class HMSPeer {
|
|
|
144
278
|
}
|
|
145
279
|
return (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'auxiliaryTracks');
|
|
146
280
|
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Retrieves the type of the peer.
|
|
284
|
+
*
|
|
285
|
+
* This getter method attempts to obtain the type of the peer, which can indicate whether the peer is a regular participant,
|
|
286
|
+
* a screen share, or another type defined within the `HMSPeerType` enum. It first tries to get this information from the HMS peers cache.
|
|
287
|
+
* If the type information is not available in the cache, it falls back to fetching the type directly from the native layer using the peer's ID.
|
|
288
|
+
* This ensures that the application has real-time access to the peer's type, which can be crucial for handling different peer types differently,
|
|
289
|
+
* such as displaying a screen share in a distinct manner. Once a value is retrieved, it updates the local `_type` property to ensure the value is current.
|
|
290
|
+
*
|
|
291
|
+
* @returns {HMSPeerType} The type of the peer, defaulting to the value stored in `_type` if the information is not available.
|
|
292
|
+
*
|
|
293
|
+
* @see https://www.100ms.live/docs/server-side/v2/how-to-guides/Session%20Initiation%20Protocol%20(SIP)/SIP-Interconnect
|
|
294
|
+
*/
|
|
147
295
|
get type() {
|
|
148
296
|
const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
|
|
149
297
|
const value = hmsPeersCache ? hmsPeersCache.getProperty(this.peerID, 'type') : (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'type');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_HMSPeersCache","require","_HMSConstants","_HMSPeerType","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HMSPeer","_updateName","_name","_updateIsLocal","_isLocal","_updateIsHandRaised","_isHandRaised","_updateCustomerUserID","_customerUserID","_updateMetadata","_metadata","_updateRole","_role","_updateType","_type","constructor","params","HMSPeerType","REGULAR","peerID","name","hmsPeersCache","getHmsPeersCache","getProperty","getPeerPropertyFromNative","HMSConstants","DEFAULT_SDK_ID","isLocal","isHandRaised","networkQuality","customerUserID","metadata","role","audioTrack","videoTrack","auxiliaryTracks","type","exports"],"sources":["HMSPeer.ts"],"sourcesContent":["import type { HMSAudioTrack } from './HMSAudioTrack';\nimport type { HMSNetworkQuality } from './HMSNetworkQuality';\nimport type { HMSRole } from './HMSRole';\nimport type { HMSTrack } from './HMSTrack';\nimport type { HMSVideoTrack } from './HMSVideoTrack';\nimport { getHmsPeersCache, getPeerPropertyFromNative } from './HMSPeersCache';\nimport { HMSConstants } from './HMSConstants';\nimport { HMSPeerType } from './HMSPeerType';\n\nexport class HMSPeer {\n peerID: string;\n private _name: string | undefined;\n private _isLocal: boolean | undefined;\n private _customerUserID: string | undefined;\n private _metadata: string | undefined;\n private _role: HMSRole | undefined;\n private _isHandRaised: boolean = false;\n private _type: HMSPeerType = HMSPeerType.REGULAR;\n\n private _updateName(value: string) {\n // If `_isLocal` is outdated, update it\n if (this._name !== value) {\n this._name = value;\n }\n }\n\n private _updateIsLocal(value: boolean) {\n // If `_isLocal` is outdated, update it\n if (this._isLocal !== value) {\n this._isLocal = value;\n }\n }\n\n private _updateIsHandRaised(value: boolean) {\n // If `_isHandRaised` is outdated, update it\n if (this._isHandRaised !== value) {\n this._isHandRaised = value;\n }\n }\n\n private _updateCustomerUserID(value: string) {\n // If `_customerUserID` is outdated, update it\n if (this._customerUserID !== value) {\n this._customerUserID = value;\n }\n }\n\n private _updateMetadata(value: string) {\n // If `_metadata` is outdated, update it\n if (this._metadata !== value) {\n this._metadata = value;\n }\n }\n\n private _updateRole(value: HMSRole) {\n // If `_role` is outdated, update it\n if (this._role !== value) {\n this._role = value;\n }\n }\n\n private _updateType(value: HMSPeerType) {\n // If `_type` is outdated, update it\n if (this._type !== value) {\n this._type = value;\n }\n }\n\n constructor(params: { peerID: string; name: string }) {\n this.peerID = params.peerID;\n this._name = params.name;\n }\n\n get name(): string | undefined {\n if (this._name) {\n return this._name;\n }\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'name')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'name'\n );\n\n if (typeof value === 'string') {\n this._updateName(value);\n }\n return value ?? this._name;\n }\n\n get isLocal(): boolean | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'isLocal')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'isLocal'\n );\n\n if (typeof value === 'boolean') {\n this._updateIsLocal(value);\n }\n return value ?? this._isLocal;\n }\n\n get isHandRaised(): boolean {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'isHandRaised')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'isHandRaised'\n );\n\n if (typeof value === 'boolean') {\n this._updateIsHandRaised(value);\n }\n return value ?? this._isHandRaised;\n }\n\n get networkQuality(): HMSNetworkQuality | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'networkQuality');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'networkQuality'\n );\n }\n\n get customerUserID(): string | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'customerUserID')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'customerUserID'\n );\n\n if (value) {\n this._updateCustomerUserID(value);\n }\n return value ?? this._customerUserID;\n }\n\n get metadata(): string | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'metadata')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'metadata'\n );\n\n if (value) {\n this._updateMetadata(value);\n }\n return value ?? this._metadata;\n }\n\n get role(): HMSRole | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'role')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'role'\n );\n\n if (value) {\n this._updateRole(value);\n }\n return value ?? this._role;\n }\n\n get audioTrack(): HMSAudioTrack | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'audioTrack');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'audioTrack'\n );\n }\n\n get videoTrack(): HMSVideoTrack | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'videoTrack');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'videoTrack'\n );\n }\n\n get auxiliaryTracks(): HMSTrack[] | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'auxiliaryTracks');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'auxiliaryTracks'\n );\n }\n\n get type(): HMSPeerType {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'type')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'type'\n );\n\n if (value) {\n this._updateType(value);\n }\n return value ?? this._type;\n }\n}\n"],"mappings":";;;;;;AAKA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,aAA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yB,WAAW,CAACzB,KAAK,CAAC;IACzB;IACA,OAAOA,KAAK,IAAI,IAAI,CAAC0B,KAAK;EAC5B;AACF;AAACuB,OAAA,CAAArC,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_HMSPeersCache","require","_HMSConstants","_HMSPeerType","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HMSPeer","_updateName","_name","_updateIsLocal","_isLocal","_updateIsHandRaised","_isHandRaised","_updateCustomerUserID","_customerUserID","_updateMetadata","_metadata","_updateRole","_role","_updateType","_type","constructor","params","HMSPeerType","REGULAR","peerID","name","hmsPeersCache","getHmsPeersCache","getProperty","getPeerPropertyFromNative","HMSConstants","DEFAULT_SDK_ID","isLocal","isHandRaised","networkQuality","customerUserID","metadata","role","audioTrack","videoTrack","auxiliaryTracks","type","exports"],"sources":["HMSPeer.ts"],"sourcesContent":["import type { HMSAudioTrack } from './HMSAudioTrack';\nimport type { HMSNetworkQuality } from './HMSNetworkQuality';\nimport type { HMSRole } from './HMSRole';\nimport type { HMSTrack } from './HMSTrack';\nimport type { HMSVideoTrack } from './HMSVideoTrack';\nimport { getHmsPeersCache, getPeerPropertyFromNative } from './HMSPeersCache';\nimport { HMSConstants } from './HMSConstants';\nimport { HMSPeerType } from './HMSPeerType';\n\n/**\n * Represents a peer in the HMS ecosystem.\n *\n * This class encapsulates the properties and state of a peer within a session, including their ID, name, role, and various status flags.\n *\n * @export\n * @class HMSPeer\n * @property {string} peerID - The unique identifier for the peer.\n * @property {string | undefined} _name - The name of the peer. Private access.\n * @property {boolean | undefined} _isLocal - Flag indicating whether the peer is the local user. Private access.\n * @property {string | undefined} _customerUserID - An optional custom user ID set by the application. Private access.\n * @property {string | undefined} _metadata - Optional metadata associated with the peer. Private access.\n * @property {HMSRole | undefined} _role - The role assigned to the peer within the session. Private access.\n * @property {boolean} _isHandRaised - Flag indicating whether the peer has raised their hand. Defaults to false. Private access.\n * @property {HMSPeerType} _type - The type of the peer, e.g., regular, screen share. Defaults to `HMSPeerType.REGULAR`. Private access.\n */\nexport class HMSPeer {\n peerID: string;\n private _name: string | undefined;\n private _isLocal: boolean | undefined;\n private _customerUserID: string | undefined;\n private _metadata: string | undefined;\n private _role: HMSRole | undefined;\n private _isHandRaised: boolean = false;\n private _type: HMSPeerType = HMSPeerType.REGULAR;\n\n private _updateName(value: string) {\n // If `_isLocal` is outdated, update it\n if (this._name !== value) {\n this._name = value;\n }\n }\n\n private _updateIsLocal(value: boolean) {\n // If `_isLocal` is outdated, update it\n if (this._isLocal !== value) {\n this._isLocal = value;\n }\n }\n\n private _updateIsHandRaised(value: boolean) {\n // If `_isHandRaised` is outdated, update it\n if (this._isHandRaised !== value) {\n this._isHandRaised = value;\n }\n }\n\n private _updateCustomerUserID(value: string) {\n // If `_customerUserID` is outdated, update it\n if (this._customerUserID !== value) {\n this._customerUserID = value;\n }\n }\n\n private _updateMetadata(value: string) {\n // If `_metadata` is outdated, update it\n if (this._metadata !== value) {\n this._metadata = value;\n }\n }\n\n private _updateRole(value: HMSRole) {\n // If `_role` is outdated, update it\n if (this._role !== value) {\n this._role = value;\n }\n }\n\n private _updateType(value: HMSPeerType) {\n // If `_type` is outdated, update it\n if (this._type !== value) {\n this._type = value;\n }\n }\n\n constructor(params: { peerID: string; name: string }) {\n this.peerID = params.peerID;\n this._name = params.name;\n }\n\n /**\n * Gets the name of the peer.\n *\n * This getter method retrieves the name of the peer. If the name has already been set locally, it returns that value.\n * Otherwise, it attempts to retrieve the name from the HMS peers cache. If the cache does not contain the name,\n * it falls back to fetching the name directly from the native layer using the peer's ID.\n * Once a value is retrieved, it updates the local `_name` property to ensure consistency.\n *\n * @returns {string | undefined} The name of the peer if available, otherwise `undefined`.\n */\n get name(): string | undefined {\n if (this._name) {\n return this._name;\n }\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'name')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'name'\n );\n\n if (typeof value === 'string') {\n this._updateName(value);\n }\n return value ?? this._name;\n }\n\n /**\n * Determines if the peer is the local user.\n *\n * This getter method checks if the peer is the local user by first attempting to retrieve the 'isLocal' property value from the HMS peers cache.\n * If the value is not found in the cache, it falls back to fetching the property directly from the native layer using the peer's ID.\n * Once a value is retrieved, it updates the local `_isLocal` property to ensure the value is current.\n *\n * @returns {boolean | undefined} True if the peer is the local user, false otherwise. Returns `undefined` if the information is not available.\n */\n get isLocal(): boolean | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'isLocal')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'isLocal'\n );\n\n if (typeof value === 'boolean') {\n this._updateIsLocal(value);\n }\n return value ?? this._isLocal;\n }\n\n /**\n * Checks if the peer has raised their hand.\n *\n * This getter method determines whether the peer has their hand raised in the session. It first attempts to retrieve the 'isHandRaised' property value\n * from the HMS peers cache. If the value is not found in the cache, it falls back to fetching the property directly from the native layer using the peer's ID.\n * Once a value is retrieved, it updates the local `_isHandRaised` property to ensure the value is current and consistent.\n *\n * @returns {boolean} True if the peer has their hand raised, false otherwise. Defaults to false if the information is not available.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/large-room\n *\n */\n get isHandRaised(): boolean {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'isHandRaised')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'isHandRaised'\n );\n\n if (typeof value === 'boolean') {\n this._updateIsHandRaised(value);\n }\n return value ?? this._isHandRaised;\n }\n\n /**\n * Retrieves the network quality of the peer.\n *\n * This getter method attempts to obtain the network quality of the peer, which is an indicator of the current network conditions affecting the peer's connection.\n * It first tries to get this information from the HMS peers cache. If the information is not available in the cache,\n * it falls back to fetching the network quality directly from the native layer using the peer's ID.\n * The network quality is represented by the `HMSNetworkQuality` type, which may include values such as 'good', 'poor', etc., depending on the implementation.\n *\n * @returns {HMSNetworkQuality | undefined} The network quality of the peer if available, otherwise `undefined`.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/network-quality\n */\n get networkQuality(): HMSNetworkQuality | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'networkQuality');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'networkQuality'\n );\n }\n\n /**\n * Retrieves the custom user ID of the peer.\n *\n * This getter method attempts to obtain the custom user ID of the peer, which is an optional identifier that can be set by the application.\n * It first tries to get this information from the HMS peers cache. If the information is not available in the cache,\n * it falls back to fetching the custom user ID directly from the native layer using the peer's ID.\n * Once a value is retrieved, it updates the local `_customerUserID` property to ensure the value is current and consistent.\n *\n * @returns {string | undefined} The custom user ID of the peer if available, otherwise `undefined`.\n */\n get customerUserID(): string | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'customerUserID')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'customerUserID'\n );\n\n if (value) {\n this._updateCustomerUserID(value);\n }\n return value ?? this._customerUserID;\n }\n\n /**\n * Retrieves the metadata associated with the peer.\n *\n * This getter method attempts to obtain the metadata of the peer, which can include any additional information set by the application.\n * It first tries to get this information from the HMS peers cache. If the information is not available in the cache,\n * it falls back to fetching the metadata directly from the native layer using the peer's ID.\n * Once a value is retrieved, it updates the local `_metadata` property to ensure the value is current and consistent.\n *\n * @returns {string | undefined} The metadata of the peer if available, otherwise `undefined`.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-metadata\n */\n get metadata(): string | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'metadata')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'metadata'\n );\n\n if (value) {\n this._updateMetadata(value);\n }\n return value ?? this._metadata;\n }\n\n /**\n * Retrieves the role of the peer.\n *\n * This getter method attempts to obtain the role assigned to the peer within the session. The role can define permissions and capabilities\n * within the session context. It first tries to get this information from the HMS peers cache. If the role information is not available in the cache,\n * it falls back to fetching the role directly from the native layer using the peer's ID. Once a value is retrieved, it updates the local `_role`\n * property to ensure the value is current and consistent.\n *\n * @returns {HMSRole | undefined} The role of the peer if available, otherwise `undefined`.\n *\n * @see https://www.100ms.live/docs/get-started/v2/get-started/concepts/templates-and-roles\n */\n get role(): HMSRole | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'role')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'role'\n );\n\n if (value) {\n this._updateRole(value);\n }\n return value ?? this._role;\n }\n\n /**\n * Retrieves the audio track associated with the peer.\n *\n * This getter method attempts to obtain the audio track of the peer. It first tries to get this information from the HMS peers cache.\n * If the audio track information is not available in the cache, it falls back to fetching the audio track directly from the native layer using the peer's ID.\n * This allows for real-time access to the peer's audio track, which can be used for various audio-related functionalities within the application.\n *\n * @returns {HMSAudioTrack | undefined} The audio track of the peer if available, otherwise `undefined`.\n */\n get audioTrack(): HMSAudioTrack | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'audioTrack');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'audioTrack'\n );\n }\n\n /**\n * Retrieves the video track associated with the peer.\n *\n * This getter method attempts to obtain the video track of the peer. It first tries to get this information from the HMS peers cache.\n * If the video track information is not available in the cache, it falls back to fetching the video track directly from the native layer using the peer's ID.\n * This allows for real-time access to the peer's video track, which can be used for various video-related functionalities within the application.\n *\n * @returns {HMSVideoTrack | undefined} The video track of the peer if available, otherwise `undefined`.\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview\n */\n get videoTrack(): HMSVideoTrack | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'videoTrack');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'videoTrack'\n );\n }\n\n /**\n * Retrieves the auxiliary tracks associated with the peer.\n *\n * This getter method attempts to obtain the auxiliary tracks of the peer, which can include tracks like screen shares or additional media streams.\n * It first tries to get this information from the HMS peers cache. If the auxiliary track information is not available in the cache,\n * it falls back to fetching the auxiliary tracks directly from the native layer using the peer's ID.\n * This allows for real-time access to the peer's auxiliary tracks, which can be used for various functionalities within the application,\n * such as displaying a screen share or additional video feeds.\n *\n * @returns {HMSTrack[] | undefined} The auxiliary tracks of the peer if available, otherwise `undefined`.\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/screenshare\n */\n get auxiliaryTracks(): HMSTrack[] | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'auxiliaryTracks');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'auxiliaryTracks'\n );\n }\n\n /**\n * Retrieves the type of the peer.\n *\n * This getter method attempts to obtain the type of the peer, which can indicate whether the peer is a regular participant,\n * a screen share, or another type defined within the `HMSPeerType` enum. It first tries to get this information from the HMS peers cache.\n * If the type information is not available in the cache, it falls back to fetching the type directly from the native layer using the peer's ID.\n * This ensures that the application has real-time access to the peer's type, which can be crucial for handling different peer types differently,\n * such as displaying a screen share in a distinct manner. Once a value is retrieved, it updates the local `_type` property to ensure the value is current.\n *\n * @returns {HMSPeerType} The type of the peer, defaulting to the value stored in `_type` if the information is not available.\n *\n * @see https://www.100ms.live/docs/server-side/v2/how-to-guides/Session%20Initiation%20Protocol%20(SIP)/SIP-Interconnect\n */\n get type(): HMSPeerType {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'type')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'type'\n );\n\n if (value) {\n this._updateType(value);\n }\n return value ?? this._type;\n }\n}\n"],"mappings":";;;;;;AAKA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAA4C,SAAAG,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,C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