@100mslive/react-native-hms 1.10.8 → 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 +19 -2
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +34 -3
- package/android/src/main/java/com/reactnativehmssdk/PipActionReceiver.kt +3 -1
- package/ios/HMSRNSDK.swift +13 -8
- 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.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 +1126 -248
- 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.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 +1126 -248
- 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 +37 -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 +1080 -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 +25 -8
- 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 +1182 -277
- 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
package/src/classes/HMSConfig.ts
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the configuration needed to join a room in the HMS ecosystem.
|
|
3
|
+
*
|
|
4
|
+
* This class encapsulates all necessary details required to initiate a connection to a room, including user identification,
|
|
5
|
+
* authentication token, optional endpoint for different server connections, metadata for additional information about the connection,
|
|
6
|
+
* and a flag to capture network quality during the preview phase.
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/join
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} params - The configuration parameters.
|
|
12
|
+
* @param {string} params.username - The username of the participant.
|
|
13
|
+
* @param {string} params.authToken - The authentication token for room access.
|
|
14
|
+
* @param {string} [params.endpoint] - Optional. The endpoint URL for the connection.
|
|
15
|
+
* @param {string} [params.metadata] - Optional. Additional metadata associated with the Local Peer.
|
|
16
|
+
* @param {boolean} [params.captureNetworkQualityInPreview] - Optional. Flag to capture network quality in the preview phase.
|
|
17
|
+
* @constructor
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const config = new HMSConfig({
|
|
21
|
+
* username: 'username',
|
|
22
|
+
* authToken: 'authToken',
|
|
23
|
+
* metadata: 'metadata',
|
|
24
|
+
* captureNetworkQualityInPreview: true,
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
1
28
|
export class HMSConfig {
|
|
2
29
|
username: string;
|
|
3
30
|
authToken: string;
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an exception specific to the HMS SDK in a React Native context.
|
|
3
|
+
*
|
|
4
|
+
* This class encapsulates detailed information about errors that can occur while interacting with the HMS SDK.
|
|
5
|
+
* It includes a numeric code to identify the type of error, a human-readable description, and optionally,
|
|
6
|
+
* a message, name, and action that are primarily available on Android. Additionally, it indicates whether
|
|
7
|
+
* the error is terminal (i.e., cannot be recovered from) and whether a retry might be possible.
|
|
8
|
+
*
|
|
9
|
+
* @class HMSException
|
|
10
|
+
* @property {number} code - Numeric error code representing the type of error.
|
|
11
|
+
* @property {string} description - A brief, human-readable description of the error.
|
|
12
|
+
* @property {string} [message] - Additional message information about the error (Android only).
|
|
13
|
+
* @property {string} [name] - The name of the error (Android only).
|
|
14
|
+
* @property {string} [action] - The action during which the error occurred (Android only).
|
|
15
|
+
* @property {boolean} isTerminal - Indicates whether the error is terminal.
|
|
16
|
+
* @property {boolean} [canRetry] - Indicates whether the operation that caused the error can be retried (Android only).
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
1
19
|
export class HMSException {
|
|
2
20
|
code: number;
|
|
3
21
|
description: string;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the structure for HLS (HTTP Live Streaming) timed metadata.
|
|
3
|
+
*
|
|
4
|
+
* This interface is used to represent metadata that can be synchronized with HLS video playback.
|
|
5
|
+
* The metadata includes a payload, which is the content of the metadata, and a duration, specifying how long (in seconds)
|
|
6
|
+
* the metadata should be displayed during the stream.
|
|
7
|
+
* This can be used for a variety of purposes such as displaying song titles, advertisements, or other relevant information at specific times during the stream.
|
|
8
|
+
*
|
|
9
|
+
* @interface HMSHLSTimedMetadata
|
|
10
|
+
* @property {string} payload - The content of the metadata to be displayed.
|
|
11
|
+
* @property {number} duration - The duration (in seconds) for which the metadata should be displayed.
|
|
12
|
+
*/
|
|
1
13
|
export interface HMSHLSTimedMetadata {
|
|
2
14
|
payload: string;
|
|
3
15
|
duration: number;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum for specifying the audio mode in an iOS environment within a 100ms (HMS) application.
|
|
3
|
+
*
|
|
4
|
+
* This enumeration provides options to configure the audio mode for an iOS application using the 100ms (HMS) SDK.
|
|
5
|
+
* It allows for the selection between `voice` and `music` modes, catering to different use cases such as
|
|
6
|
+
* prioritizing voice clarity or enhancing music quality during a session.
|
|
7
|
+
*
|
|
8
|
+
* @enum {string}
|
|
9
|
+
* @property {string} VOICE - Configures the audio session for optimized voice communication.
|
|
10
|
+
* This mode enhances voice clarity, making it suitable for calls or conferences.
|
|
11
|
+
* @property {string} MUSIC - Configures the audio session for music playback.
|
|
12
|
+
* This mode enhances music fidelity, making it suitable for streams or recordings that prioritize music quality.
|
|
13
|
+
*
|
|
14
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/microphone/music-mode
|
|
15
|
+
*/
|
|
1
16
|
export enum HMSIOSAudioMode {
|
|
2
17
|
VOICE = 'voice',
|
|
3
18
|
MUSIC = 'music',
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration for managing log alarm settings in HMS SDK for React Native applications. Android only.
|
|
3
|
+
*
|
|
4
|
+
* This enumeration defines constants used to configure the alarm manager for log files in the HMS SDK.
|
|
5
|
+
* It includes settings for the default directory size, default log file name, and maximum directory size,
|
|
6
|
+
* allowing for detailed control over how log files are managed and stored.
|
|
7
|
+
*
|
|
8
|
+
* @enum {string}
|
|
9
|
+
* @property {string} DEFAULT_DIR_SIZE - Represents the default size for the log directory.
|
|
10
|
+
* @property {string} DEFAULT_LOGS_FILE_NAME - Represents the default name for log files.
|
|
11
|
+
* @property {string} MAX_DIR_SIZE - Represents the maximum size for the log directory.
|
|
12
|
+
*/
|
|
1
13
|
export enum HMSLogAlarmManager {
|
|
2
14
|
DEFAULT_DIR_SIZE = 'DEFAULT_DIR_SIZE',
|
|
3
15
|
DEFAULT_LOGS_FILE_NAME = 'DEFAULT_LOGS_FILE_NAME',
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration for defining log levels in the HMS SDK for React Native applications.
|
|
3
|
+
*
|
|
4
|
+
* This enumeration provides a set of predefined log levels that can be used to control the verbosity of logging
|
|
5
|
+
* within the HMS SDK. It allows developers to specify how much detail they want in their logs, which can be
|
|
6
|
+
* helpful for debugging or monitoring the application's behavior.
|
|
7
|
+
*
|
|
8
|
+
* @enum {string}
|
|
9
|
+
* @property {string} VERBOSE - Represents the most verbose log level, including detailed debug information.
|
|
10
|
+
* @property {string} WARNING - Represents a log level for warning messages that might indicate potential issues.
|
|
11
|
+
* @property {string} ERROR - Represents a log level for error messages indicating failures that need attention.
|
|
12
|
+
*/
|
|
1
13
|
export enum HMSLogLevel {
|
|
2
14
|
VERBOSE = 'VERBOSE',
|
|
3
15
|
WARNING = 'WARNING',
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import type { HMSLogAlarmManager } from './HMSLogAlarmManager';
|
|
2
2
|
import type { HMSLogLevel } from './HMSLogLevel';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Represents the logging settings for the HMS SDK.
|
|
6
|
+
*
|
|
7
|
+
* This class encapsulates the settings related to logging within the HMS SDK, including the log level,
|
|
8
|
+
* whether log storage is enabled, and the maximum directory size for log storage.
|
|
9
|
+
* It is used to configure how logs are handled by the SDK, allowing for customization of log verbosity and storage requirements.
|
|
10
|
+
*
|
|
11
|
+
* @class HMSLogSettings
|
|
12
|
+
* @property {HMSLogLevel} level - The log level setting, determining the verbosity of the logs.
|
|
13
|
+
* @property {boolean} isLogStorageEnabled - Flag indicating whether log storage is enabled. Android only.
|
|
14
|
+
* @property {HMSLogAlarmManager} maxDirSizeInBytes - The maximum size of the log directory in bytes, managed by an instance of HMSLogAlarmManager. Android only.
|
|
15
|
+
*
|
|
16
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/debugging/logger
|
|
17
|
+
*/
|
|
4
18
|
export class HMSLogSettings {
|
|
5
19
|
level: HMSLogLevel;
|
|
6
20
|
isLogStorageEnabled: boolean;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the network quality of a connection in the HMS (100ms) system.
|
|
3
|
+
*
|
|
4
|
+
* This class encapsulates the network quality information, specifically focusing on the downlink quality of the connection.
|
|
5
|
+
* The downlink quality is represented as a numerical value, providing a quantifiable measure of the receiving end's network performance.
|
|
6
|
+
*
|
|
7
|
+
* @param {Object} params - The constructor parameters.
|
|
8
|
+
* @param {number} params.downlinkQuality - The downlink quality of the network connection.
|
|
9
|
+
*
|
|
10
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/network-quality
|
|
11
|
+
*/
|
|
1
12
|
export class HMSNetworkQuality {
|
|
2
13
|
downlinkQuality: number;
|
|
3
14
|
|
|
@@ -3,18 +3,49 @@ import { HMSConstants } from './HMSConstants';
|
|
|
3
3
|
import { logger } from './HMSLogger';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Represents the HMS Noise Cancellation Plugin.
|
|
7
|
+
* 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.
|
|
8
|
+
*
|
|
9
|
+
* @property {HMSNoiseCancellationModels} modelName - Specifies the model of noise cancellation to be used.
|
|
10
|
+
* This property determines the algorithm and intensity of noise cancellation, allowing for customization
|
|
11
|
+
* based on the requirements of the room or application.
|
|
12
|
+
*
|
|
13
|
+
* @property {HMSNoiseCancellationInitialState} initialState - Defines the initial state of noise cancellation
|
|
14
|
+
* when the plugin is instantiated. This can be either enabled or disabled, providing control over the
|
|
15
|
+
* noise cancellation feature's activation upon initialization.
|
|
16
|
+
*
|
|
17
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/noise-cancellation
|
|
8
18
|
*/
|
|
9
19
|
export class HMSNoiseCancellationPlugin {
|
|
20
|
+
/**
|
|
21
|
+
* The `modelName` property specifies the model of noise cancellation to be used within the HMS Noise Cancellation Plugin.
|
|
22
|
+
* This property determines the algorithm and intensity of noise cancellation, allowing for customization
|
|
23
|
+
* based on the specific requirements of the room or application. It is of type `HMSNoiseCancellationModels`,
|
|
24
|
+
* an enum that defines the available noise cancellation models.
|
|
25
|
+
*/
|
|
10
26
|
modelName: HMSNoiseCancellationModels;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Defines the initial state of noise cancellation when the plugin is instantiated.
|
|
30
|
+
* This property can be set to either `HMSNoiseCancellationInitialState.Enabled`
|
|
31
|
+
* or `HMSNoiseCancellationInitialState.Disabled`, determining whether noise cancellation should be active
|
|
32
|
+
* immediately upon the plugin's instantiation. This allows for control over the feature's initial activation state,
|
|
33
|
+
* catering to scenarios where noise cancellation needs to be either immediately available or manually activated later.
|
|
34
|
+
*/
|
|
11
35
|
initialState: HMSNoiseCancellationInitialState;
|
|
12
36
|
|
|
13
37
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
38
|
+
* Constructs a new HMSNoiseCancellationPlugin instance with optional configuration settings.
|
|
39
|
+
* This constructor allows for the initialization of the plugin with specific noise cancellation
|
|
40
|
+
* model and initial state settings, providing flexibility in how noise cancellation is applied
|
|
41
|
+
* within the application.
|
|
42
|
+
*
|
|
43
|
+
* @param {Object} [config] - Optional configuration object for the plugin.
|
|
44
|
+
* @param {HMSNoiseCancellationModels} [config.modelName] - Specifies the noise cancellation model to be used.
|
|
45
|
+
* This determines the algorithm and intensity of noise cancellation. If not provided, a default
|
|
46
|
+
* model is used.
|
|
47
|
+
* @param {HMSNoiseCancellationInitialState} [config.initialState] - Sets the initial state of noise cancellation
|
|
48
|
+
* (enabled or disabled) when the plugin is instantiated. Defaults to disabled if not specified.
|
|
18
49
|
*/
|
|
19
50
|
constructor(config?: {
|
|
20
51
|
modelName: HMSNoiseCancellationModels;
|
|
@@ -45,7 +76,7 @@ export class HMSNoiseCancellationPlugin {
|
|
|
45
76
|
);
|
|
46
77
|
|
|
47
78
|
try {
|
|
48
|
-
return HMSManagerModule.isNoiseCancellationPluginAvailable(data);
|
|
79
|
+
return await HMSManagerModule.isNoiseCancellationPluginAvailable(data);
|
|
49
80
|
} catch (e) {
|
|
50
81
|
logger?.error(
|
|
51
82
|
'#Error in #Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable ',
|
|
@@ -64,7 +95,7 @@ export class HMSNoiseCancellationPlugin {
|
|
|
64
95
|
logger?.verbose('#Function HMSNoiseCancellationPlugin#enable', data);
|
|
65
96
|
|
|
66
97
|
try {
|
|
67
|
-
return HMSManagerModule.enableNoiseCancellationPlugin(data);
|
|
98
|
+
return await HMSManagerModule.enableNoiseCancellationPlugin(data);
|
|
68
99
|
} catch (e) {
|
|
69
100
|
logger?.error(
|
|
70
101
|
'#Error in #Function HMSNoiseCancellationPlugin#enable ',
|
|
@@ -83,7 +114,7 @@ export class HMSNoiseCancellationPlugin {
|
|
|
83
114
|
logger?.verbose('#Function HMSNoiseCancellationPlugin#disable', data);
|
|
84
115
|
|
|
85
116
|
try {
|
|
86
|
-
return HMSManagerModule.disableNoiseCancellationPlugin(data);
|
|
117
|
+
return await HMSManagerModule.disableNoiseCancellationPlugin(data);
|
|
87
118
|
} catch (e) {
|
|
88
119
|
logger?.error(
|
|
89
120
|
'#Error in #Function HMSNoiseCancellationPlugin#disable ',
|
|
@@ -102,7 +133,7 @@ export class HMSNoiseCancellationPlugin {
|
|
|
102
133
|
logger?.verbose('#Function HMSNoiseCancellationPlugin#isEnabled', data);
|
|
103
134
|
|
|
104
135
|
try {
|
|
105
|
-
return HMSManagerModule.isNoiseCancellationPluginEnabled(data);
|
|
136
|
+
return await HMSManagerModule.isNoiseCancellationPluginEnabled(data);
|
|
106
137
|
} catch (e) {
|
|
107
138
|
logger?.error(
|
|
108
139
|
'#Error in #Function HMSNoiseCancellationPlugin#isEnabled ',
|
|
@@ -1,36 +1,53 @@
|
|
|
1
1
|
import type { HMSVideoViewMode } from './HMSVideoViewMode';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Configuration options for Picture-in-Picture (PIP) mode in a React Native application using HMS.
|
|
5
|
+
*
|
|
6
|
+
* This interface defines the settings available for customizing the PIP window that can appear when the app enters background mode.
|
|
7
|
+
* It includes options for automatically entering PIP mode, adjusting the aspect ratio and scale type of the PIP window, and toggling
|
|
8
|
+
* the visibility of various control buttons specific to Android or iOS platforms.
|
|
9
|
+
*
|
|
10
|
+
* @interface HMSPIPConfig
|
|
11
|
+
* @property {boolean} [autoEnterPipMode] - Determines whether the app should automatically enter PIP mode when it goes into the background.
|
|
12
|
+
* @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.
|
|
13
|
+
* @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.
|
|
14
|
+
* @property {boolean} [useActiveSpeaker] - Whether the PIP window should automatically show the active speaker. Default is true. Applies only to iOS.
|
|
15
|
+
* @property {boolean} [endButton] - Controls the visibility of the end call button within the PIP window. Default is true. Applies only to Android.
|
|
16
|
+
* @property {boolean} [audioButton] - Controls the visibility of the audio mute/unmute button within the PIP window. Default is true. Applies only to Android.
|
|
17
|
+
* @property {boolean} [videoButton] - Controls the visibility of the video mute/unmute button within the PIP window. Default is true. Applies only to Android.
|
|
18
|
+
*/
|
|
3
19
|
export interface HMSPIPConfig {
|
|
4
|
-
|
|
20
|
+
/**
|
|
5
21
|
* Whether to automatically enter PIP mode when app enters background.
|
|
6
22
|
*/
|
|
7
23
|
autoEnterPipMode?: boolean;
|
|
8
24
|
|
|
9
|
-
|
|
10
|
-
* The aspect ratio of the PIP window. Default is [9, 16]. Other values can be [3, 4], [1, 1], [4, 3], [16, 9].
|
|
25
|
+
/**
|
|
26
|
+
* 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].
|
|
11
27
|
*/
|
|
12
28
|
aspectRatio?: [number, number];
|
|
13
29
|
|
|
14
|
-
|
|
30
|
+
/**
|
|
15
31
|
* The scale type of the PIP window. Default is ASPECT_FILL. Other values can be ASPECT_FIT, ASPECT_BALANCED. iOS Only.
|
|
16
32
|
*/
|
|
17
33
|
scaleType?: HMSVideoViewMode;
|
|
18
34
|
|
|
19
|
-
|
|
35
|
+
/**
|
|
20
36
|
* Whether to show the Active Speaker in the PIP window. Default is true. iOS only.
|
|
21
37
|
*/
|
|
22
38
|
useActiveSpeaker?: boolean;
|
|
23
|
-
|
|
39
|
+
|
|
40
|
+
/**
|
|
24
41
|
* Whether to show the end button in the PIP window. Default is true. Android only.
|
|
25
42
|
*/
|
|
26
43
|
endButton?: boolean;
|
|
27
44
|
|
|
28
|
-
|
|
45
|
+
/**
|
|
29
46
|
* Whether to show the audio mute/unmute button in the PIP window. Default is true. Android only.
|
|
30
47
|
*/
|
|
31
48
|
audioButton?: boolean;
|
|
32
49
|
|
|
33
|
-
|
|
50
|
+
/**
|
|
34
51
|
* Whether to show the video mute/unmute button in the PIP window. Default is true. Android only.
|
|
35
52
|
*/
|
|
36
53
|
videoButton?: boolean;
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum for HMS Picture-in-Picture (PIP) Listener Actions.
|
|
3
|
+
*
|
|
4
|
+
* This enum defines the types of actions/events related to the Picture-in-Picture (PIP) mode that can be listened to
|
|
5
|
+
* within the HMS SDK. These actions allow the application to respond to changes in PIP mode or when the room is left
|
|
6
|
+
* while in PIP mode.
|
|
7
|
+
*
|
|
8
|
+
* @enum {string}
|
|
9
|
+
*/
|
|
1
10
|
export enum HMSPIPListenerActions {
|
|
11
|
+
/**
|
|
12
|
+
* Action triggered when the Picture-in-Picture mode changes.
|
|
13
|
+
* This can be used to handle UI changes or other logic when entering or exiting PIP mode.
|
|
14
|
+
*/
|
|
2
15
|
ON_PIP_MODE_CHANGED = 'ON_PIP_MODE_CHANGED',
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Action triggered when the room is left while in Picture-in-Picture mode. Android only.
|
|
19
|
+
* This can be used to clean up resources or update the UI accordingly.
|
|
20
|
+
*/
|
|
3
21
|
ON_PIP_ROOM_LEAVE = 'ON_PIP_ROOM_LEAVE',
|
|
4
22
|
}
|
package/src/classes/HMSPeer.ts
CHANGED
|
@@ -7,6 +7,22 @@ import { getHmsPeersCache, getPeerPropertyFromNative } from './HMSPeersCache';
|
|
|
7
7
|
import { HMSConstants } from './HMSConstants';
|
|
8
8
|
import { HMSPeerType } from './HMSPeerType';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Represents a peer in the HMS ecosystem.
|
|
12
|
+
*
|
|
13
|
+
* This class encapsulates the properties and state of a peer within a session, including their ID, name, role, and various status flags.
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @class HMSPeer
|
|
17
|
+
* @property {string} peerID - The unique identifier for the peer.
|
|
18
|
+
* @property {string | undefined} _name - The name of the peer. Private access.
|
|
19
|
+
* @property {boolean | undefined} _isLocal - Flag indicating whether the peer is the local user. Private access.
|
|
20
|
+
* @property {string | undefined} _customerUserID - An optional custom user ID set by the application. Private access.
|
|
21
|
+
* @property {string | undefined} _metadata - Optional metadata associated with the peer. Private access.
|
|
22
|
+
* @property {HMSRole | undefined} _role - The role assigned to the peer within the session. Private access.
|
|
23
|
+
* @property {boolean} _isHandRaised - Flag indicating whether the peer has raised their hand. Defaults to false. Private access.
|
|
24
|
+
* @property {HMSPeerType} _type - The type of the peer, e.g., regular, screen share. Defaults to `HMSPeerType.REGULAR`. Private access.
|
|
25
|
+
*/
|
|
10
26
|
export class HMSPeer {
|
|
11
27
|
peerID: string;
|
|
12
28
|
private _name: string | undefined;
|
|
@@ -71,6 +87,16 @@ export class HMSPeer {
|
|
|
71
87
|
this._name = params.name;
|
|
72
88
|
}
|
|
73
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Gets the name of the peer.
|
|
92
|
+
*
|
|
93
|
+
* This getter method retrieves the name of the peer. If the name has already been set locally, it returns that value.
|
|
94
|
+
* Otherwise, it attempts to retrieve the name from the HMS peers cache. If the cache does not contain the name,
|
|
95
|
+
* it falls back to fetching the name directly from the native layer using the peer's ID.
|
|
96
|
+
* Once a value is retrieved, it updates the local `_name` property to ensure consistency.
|
|
97
|
+
*
|
|
98
|
+
* @returns {string | undefined} The name of the peer if available, otherwise `undefined`.
|
|
99
|
+
*/
|
|
74
100
|
get name(): string | undefined {
|
|
75
101
|
if (this._name) {
|
|
76
102
|
return this._name;
|
|
@@ -91,6 +117,15 @@ export class HMSPeer {
|
|
|
91
117
|
return value ?? this._name;
|
|
92
118
|
}
|
|
93
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Determines if the peer is the local user.
|
|
122
|
+
*
|
|
123
|
+
* 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.
|
|
124
|
+
* 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.
|
|
125
|
+
* Once a value is retrieved, it updates the local `_isLocal` property to ensure the value is current.
|
|
126
|
+
*
|
|
127
|
+
* @returns {boolean | undefined} True if the peer is the local user, false otherwise. Returns `undefined` if the information is not available.
|
|
128
|
+
*/
|
|
94
129
|
get isLocal(): boolean | undefined {
|
|
95
130
|
const hmsPeersCache = getHmsPeersCache();
|
|
96
131
|
|
|
@@ -108,6 +143,18 @@ export class HMSPeer {
|
|
|
108
143
|
return value ?? this._isLocal;
|
|
109
144
|
}
|
|
110
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Checks if the peer has raised their hand.
|
|
148
|
+
*
|
|
149
|
+
* This getter method determines whether the peer has their hand raised in the session. It first attempts to retrieve the 'isHandRaised' property value
|
|
150
|
+
* 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.
|
|
151
|
+
* Once a value is retrieved, it updates the local `_isHandRaised` property to ensure the value is current and consistent.
|
|
152
|
+
*
|
|
153
|
+
* @returns {boolean} True if the peer has their hand raised, false otherwise. Defaults to false if the information is not available.
|
|
154
|
+
*
|
|
155
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/large-room
|
|
156
|
+
*
|
|
157
|
+
*/
|
|
111
158
|
get isHandRaised(): boolean {
|
|
112
159
|
const hmsPeersCache = getHmsPeersCache();
|
|
113
160
|
|
|
@@ -125,6 +172,18 @@ export class HMSPeer {
|
|
|
125
172
|
return value ?? this._isHandRaised;
|
|
126
173
|
}
|
|
127
174
|
|
|
175
|
+
/**
|
|
176
|
+
* Retrieves the network quality of the peer.
|
|
177
|
+
*
|
|
178
|
+
* 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.
|
|
179
|
+
* It first tries to get this information from the HMS peers cache. If the information is not available in the cache,
|
|
180
|
+
* it falls back to fetching the network quality directly from the native layer using the peer's ID.
|
|
181
|
+
* The network quality is represented by the `HMSNetworkQuality` type, which may include values such as 'good', 'poor', etc., depending on the implementation.
|
|
182
|
+
*
|
|
183
|
+
* @returns {HMSNetworkQuality | undefined} The network quality of the peer if available, otherwise `undefined`.
|
|
184
|
+
*
|
|
185
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/network-quality
|
|
186
|
+
*/
|
|
128
187
|
get networkQuality(): HMSNetworkQuality | undefined {
|
|
129
188
|
const hmsPeersCache = getHmsPeersCache();
|
|
130
189
|
|
|
@@ -139,6 +198,16 @@ export class HMSPeer {
|
|
|
139
198
|
);
|
|
140
199
|
}
|
|
141
200
|
|
|
201
|
+
/**
|
|
202
|
+
* Retrieves the custom user ID of the peer.
|
|
203
|
+
*
|
|
204
|
+
* 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.
|
|
205
|
+
* It first tries to get this information from the HMS peers cache. If the information is not available in the cache,
|
|
206
|
+
* it falls back to fetching the custom user ID directly from the native layer using the peer's ID.
|
|
207
|
+
* Once a value is retrieved, it updates the local `_customerUserID` property to ensure the value is current and consistent.
|
|
208
|
+
*
|
|
209
|
+
* @returns {string | undefined} The custom user ID of the peer if available, otherwise `undefined`.
|
|
210
|
+
*/
|
|
142
211
|
get customerUserID(): string | undefined {
|
|
143
212
|
const hmsPeersCache = getHmsPeersCache();
|
|
144
213
|
|
|
@@ -156,6 +225,18 @@ export class HMSPeer {
|
|
|
156
225
|
return value ?? this._customerUserID;
|
|
157
226
|
}
|
|
158
227
|
|
|
228
|
+
/**
|
|
229
|
+
* Retrieves the metadata associated with the peer.
|
|
230
|
+
*
|
|
231
|
+
* This getter method attempts to obtain the metadata of the peer, which can include any additional information set by the application.
|
|
232
|
+
* It first tries to get this information from the HMS peers cache. If the information is not available in the cache,
|
|
233
|
+
* it falls back to fetching the metadata directly from the native layer using the peer's ID.
|
|
234
|
+
* Once a value is retrieved, it updates the local `_metadata` property to ensure the value is current and consistent.
|
|
235
|
+
*
|
|
236
|
+
* @returns {string | undefined} The metadata of the peer if available, otherwise `undefined`.
|
|
237
|
+
*
|
|
238
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-metadata
|
|
239
|
+
*/
|
|
159
240
|
get metadata(): string | undefined {
|
|
160
241
|
const hmsPeersCache = getHmsPeersCache();
|
|
161
242
|
|
|
@@ -173,6 +254,18 @@ export class HMSPeer {
|
|
|
173
254
|
return value ?? this._metadata;
|
|
174
255
|
}
|
|
175
256
|
|
|
257
|
+
/**
|
|
258
|
+
* Retrieves the role of the peer.
|
|
259
|
+
*
|
|
260
|
+
* This getter method attempts to obtain the role assigned to the peer within the session. The role can define permissions and capabilities
|
|
261
|
+
* 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,
|
|
262
|
+
* 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`
|
|
263
|
+
* property to ensure the value is current and consistent.
|
|
264
|
+
*
|
|
265
|
+
* @returns {HMSRole | undefined} The role of the peer if available, otherwise `undefined`.
|
|
266
|
+
*
|
|
267
|
+
* @see https://www.100ms.live/docs/get-started/v2/get-started/concepts/templates-and-roles
|
|
268
|
+
*/
|
|
176
269
|
get role(): HMSRole | undefined {
|
|
177
270
|
const hmsPeersCache = getHmsPeersCache();
|
|
178
271
|
|
|
@@ -190,6 +283,15 @@ export class HMSPeer {
|
|
|
190
283
|
return value ?? this._role;
|
|
191
284
|
}
|
|
192
285
|
|
|
286
|
+
/**
|
|
287
|
+
* Retrieves the audio track associated with the peer.
|
|
288
|
+
*
|
|
289
|
+
* This getter method attempts to obtain the audio track of the peer. It first tries to get this information from the HMS peers cache.
|
|
290
|
+
* 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.
|
|
291
|
+
* This allows for real-time access to the peer's audio track, which can be used for various audio-related functionalities within the application.
|
|
292
|
+
*
|
|
293
|
+
* @returns {HMSAudioTrack | undefined} The audio track of the peer if available, otherwise `undefined`.
|
|
294
|
+
*/
|
|
193
295
|
get audioTrack(): HMSAudioTrack | undefined {
|
|
194
296
|
const hmsPeersCache = getHmsPeersCache();
|
|
195
297
|
|
|
@@ -204,6 +306,16 @@ export class HMSPeer {
|
|
|
204
306
|
);
|
|
205
307
|
}
|
|
206
308
|
|
|
309
|
+
/**
|
|
310
|
+
* Retrieves the video track associated with the peer.
|
|
311
|
+
*
|
|
312
|
+
* This getter method attempts to obtain the video track of the peer. It first tries to get this information from the HMS peers cache.
|
|
313
|
+
* 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.
|
|
314
|
+
* This allows for real-time access to the peer's video track, which can be used for various video-related functionalities within the application.
|
|
315
|
+
*
|
|
316
|
+
* @returns {HMSVideoTrack | undefined} The video track of the peer if available, otherwise `undefined`.
|
|
317
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview
|
|
318
|
+
*/
|
|
207
319
|
get videoTrack(): HMSVideoTrack | undefined {
|
|
208
320
|
const hmsPeersCache = getHmsPeersCache();
|
|
209
321
|
|
|
@@ -218,6 +330,18 @@ export class HMSPeer {
|
|
|
218
330
|
);
|
|
219
331
|
}
|
|
220
332
|
|
|
333
|
+
/**
|
|
334
|
+
* Retrieves the auxiliary tracks associated with the peer.
|
|
335
|
+
*
|
|
336
|
+
* This getter method attempts to obtain the auxiliary tracks of the peer, which can include tracks like screen shares or additional media streams.
|
|
337
|
+
* It first tries to get this information from the HMS peers cache. If the auxiliary track information is not available in the cache,
|
|
338
|
+
* it falls back to fetching the auxiliary tracks directly from the native layer using the peer's ID.
|
|
339
|
+
* This allows for real-time access to the peer's auxiliary tracks, which can be used for various functionalities within the application,
|
|
340
|
+
* such as displaying a screen share or additional video feeds.
|
|
341
|
+
*
|
|
342
|
+
* @returns {HMSTrack[] | undefined} The auxiliary tracks of the peer if available, otherwise `undefined`.
|
|
343
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/screenshare
|
|
344
|
+
*/
|
|
221
345
|
get auxiliaryTracks(): HMSTrack[] | undefined {
|
|
222
346
|
const hmsPeersCache = getHmsPeersCache();
|
|
223
347
|
|
|
@@ -232,6 +356,19 @@ export class HMSPeer {
|
|
|
232
356
|
);
|
|
233
357
|
}
|
|
234
358
|
|
|
359
|
+
/**
|
|
360
|
+
* Retrieves the type of the peer.
|
|
361
|
+
*
|
|
362
|
+
* This getter method attempts to obtain the type of the peer, which can indicate whether the peer is a regular participant,
|
|
363
|
+
* a screen share, or another type defined within the `HMSPeerType` enum. It first tries to get this information from the HMS peers cache.
|
|
364
|
+
* 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.
|
|
365
|
+
* This ensures that the application has real-time access to the peer's type, which can be crucial for handling different peer types differently,
|
|
366
|
+
* 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.
|
|
367
|
+
*
|
|
368
|
+
* @returns {HMSPeerType} The type of the peer, defaulting to the value stored in `_type` if the information is not available.
|
|
369
|
+
*
|
|
370
|
+
* @see https://www.100ms.live/docs/server-side/v2/how-to-guides/Session%20Initiation%20Protocol%20(SIP)/SIP-Interconnect
|
|
371
|
+
*/
|
|
235
372
|
get type(): HMSPeerType {
|
|
236
373
|
const hmsPeersCache = getHmsPeersCache();
|
|
237
374
|
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum for HMSPeerType.
|
|
3
|
+
*
|
|
4
|
+
* Defines the types of peers within the HMS (100ms) system. This enumeration is used to distinguish between different
|
|
5
|
+
* kinds of peers, such as SIP (Session Initiation Protocol) peers and regular peers. Each peer type has specific
|
|
6
|
+
* characteristics and roles within the video conferencing or communication context.
|
|
7
|
+
*
|
|
8
|
+
* @enum {string}
|
|
9
|
+
*
|
|
10
|
+
* @see https://www.100ms.live/docs/server-side/v2/how-to-guides/Session%20Initiation%20Protocol%20(SIP)/SIP-Interconnect
|
|
11
|
+
*/
|
|
1
12
|
export enum HMSPeerType {
|
|
2
|
-
SIP = 'SIP',
|
|
3
|
-
REGULAR = 'REGULAR',
|
|
13
|
+
SIP = 'SIP', // Represents a SIP peer, typically used for integrating with traditional telephony systems.
|
|
14
|
+
REGULAR = 'REGULAR', // Represents a regular peer, such as a standard user in a video call.
|
|
4
15
|
}
|
|
5
16
|
|
|
6
17
|
export const HMSPeerTypeOrdinals = new Map([
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import type { HMSRtmpVideoResolution } from './HMSRtmpVideoResolution';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Configuration class for RTMP streaming in the HMS (100ms) system.
|
|
5
|
+
*
|
|
6
|
+
* This class encapsulates the settings required to configure RTMP (Real-Time Messaging Protocol) streaming for a meeting.
|
|
7
|
+
* It includes options for the meeting URL, RTMP URLs for streaming, whether recording should be enabled, and the video resolution for the stream.
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} params - The constructor parameters.
|
|
10
|
+
* @param {string} [params.meetingURL] - The URL of the meeting to be streamed. Optional.
|
|
11
|
+
* @param {Array<string>} [params.rtmpURLs] - An array of RTMP URLs to which the meeting will be streamed. Optional.
|
|
12
|
+
* @param {boolean} params.record - Flag indicating whether the stream should be recorded.
|
|
13
|
+
* @param {HMSRtmpVideoResolution} [params.resolution] - The resolution of the video to be streamed. Optional.
|
|
14
|
+
*
|
|
15
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/recording
|
|
16
|
+
*/
|
|
3
17
|
export class HMSRTMPConfig {
|
|
4
18
|
meetingURL?: string;
|
|
5
19
|
rtmpURLs?: Array<string>;
|
package/src/classes/HMSRole.ts
CHANGED
|
@@ -2,6 +2,23 @@ import type { HMSPermissions } from './HMSPermissions';
|
|
|
2
2
|
import type { HMSPublishSettings } from './HMSPublishSettings';
|
|
3
3
|
import type { HMSSubscribeSettings } from './HMSSubscribeSettings';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Represents a role within the HMS ecosystem.
|
|
7
|
+
*
|
|
8
|
+
* A role defines the capabilities and permissions a user has in a session, such as publishing or subscribing to streams,
|
|
9
|
+
* and the priority of the user in the session. This class encapsulates the properties of a role, including its name,
|
|
10
|
+
* publishing settings, subscribing settings, permissions, and priority.
|
|
11
|
+
*
|
|
12
|
+
* @class HMSRole
|
|
13
|
+
* @property {string} [name] - The name of the role.
|
|
14
|
+
* @property {HMSPublishSettings} [publishSettings] - Settings related to publishing streams for this role.
|
|
15
|
+
* @property {HMSSubscribeSettings} [subscribeSettings] - Settings related to subscribing to streams for this role.
|
|
16
|
+
* @property {HMSPermissions} [permissions] - Permissions granted to this role.
|
|
17
|
+
* @property {number} [priority] - The priority of the role, determining its precedence in the session.
|
|
18
|
+
*
|
|
19
|
+
* @see https://www.100ms.live/docs/get-started/v2/get-started/concepts/templates-and-roles
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
5
22
|
export class HMSRole {
|
|
6
23
|
name?: string;
|
|
7
24
|
publishSettings?: HMSPublishSettings;
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the video resolution for RTMP streaming in the HMS (100ms) system.
|
|
3
|
+
*
|
|
4
|
+
* This class encapsulates the dimensions (height and width) of the video resolution to be used for RTMP streaming.
|
|
5
|
+
* It allows for specifying the video quality by defining the resolution, which is crucial for optimizing the streaming experience
|
|
6
|
+
* based on the bandwidth available and the requirements of the streaming platform.
|
|
7
|
+
*
|
|
8
|
+
* @param {Object} params - The constructor parameters.
|
|
9
|
+
* @param {number} params.height - The height of the video resolution.
|
|
10
|
+
* @param {number} params.width - The width of the video resolution.
|
|
11
|
+
*
|
|
12
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/recording
|
|
13
|
+
*/
|
|
1
14
|
export class HMSRtmpVideoResolution {
|
|
2
15
|
height: number;
|
|
3
16
|
width: number;
|