Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated inline code comments #1408

Merged
merged 10 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,7 @@ class HMSRNSDK(

if (audioTrackId == trackId) {
peer.audioTrack?.setVolume(volume)
callback?.resolve(null)
return
}

Expand All @@ -1478,6 +1479,7 @@ class HMSRNSDK(

if (trackExtracted != null) {
trackExtracted.setVolume(volume)
callback?.resolve(null)
return
}
}
Expand Down Expand Up @@ -1750,7 +1752,7 @@ class HMSRNSDK(
val audioDevice = data.getString("audioDevice")
hmsSDK?.let {
it.switchAudioOutput(HMSHelper.getAudioDevice(audioDevice))
callback?.resolve(true)
callback?.resolve(null)
}
} else {
val errorMessage = "switchAudioOutput: $requiredKeys"
Expand Down Expand Up @@ -1836,7 +1838,7 @@ class HMSRNSDK(
override fun onSuccess() {
isAudioSharing = false
audioshareCallback = null
callback?.resolve(getPromiseResolveData())
callback?.resolve(true)
}
},
)
Expand All @@ -1854,7 +1856,7 @@ class HMSRNSDK(
val mode = HMSHelper.getAudioMixingMode(data.getString("audioMixingMode"))
audioMixingMode = mode
hmsSDK?.setAudioMixingMode(mode)
callback?.resolve(getPromiseResolveData())
callback?.resolve(true)
} else {
val errorMessage = "setAudioMixingMode: $requiredKeys"
rejectCallback(callback, errorMessage)
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-hms/ios/HMSRNSDK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ class HMSRNSDK: NSObject, HMSUpdateListener, HMSPreviewListener {

if remoteAudioTrack != nil {
remoteAudioTrack?.setVolume(volume)
resolve?(true)
resolve?(nil)
} else {
let errorMessage = "setVolume: No remote audio track not available"
reject?(errorMessage, errorMessage, nil)
Expand Down
18 changes: 18 additions & 0 deletions packages/react-native-hms/src/classes/HMSAudioDevice.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
/**
* Enum for HMSAudioDevice types.
*
* This enum represents the different types of audio devices that can be used
* in the context of the HMS SDK. It provides a way to specify the preferred
* audio output device for audio playback.
*
* @enum {string}
*/
export enum HMSAudioDevice {
/** Use the speakerphone for audio output. */
SPEAKER_PHONE = 'SPEAKER_PHONE',

/** Use a wired headset for audio output, if connected. */
WIRED_HEADSET = 'WIRED_HEADSET',

/** Use the earpiece for audio output. */
EARPIECE = 'EARPIECE',

/** Use a Bluetooth device for audio output, if connected. */
BLUETOOTH = 'BLUETOOTH',

/** Automatically select the best audio output device based on the current state. */
AUTOMATIC = 'AUTOMATIC',
}
11 changes: 11 additions & 0 deletions packages/react-native-hms/src/classes/HMSCameraFacing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
/**
* Enum for camera facing directions in a 100ms (HMS) application.
*
* This enumeration defines the possible camera facing options for video tracks in a 100ms (HMS) application, allowing developers to specify whether the front or back camera should be used during a video session.
* This can be particularly useful for applications that need to switch between cameras or provide users with the option to choose their preferred camera.
*
* @enum {string}
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/mute#switch-camera
*/
export enum HMSCameraFacing {
/** Represents the front camera on a device. */
FRONT = 'FRONT',
/** Represents the back camera on a device. */
BACK = 'BACK',
}
18 changes: 18 additions & 0 deletions packages/react-native-hms/src/classes/HMSException.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/**
* Represents an exception specific to the HMS SDK in a React Native context.
*
* This class encapsulates detailed information about errors that can occur while interacting with the HMS SDK.
* It includes a numeric code to identify the type of error, a human-readable description, and optionally,
* a message, name, and action that are primarily available on Android. Additionally, it indicates whether
* the error is terminal (i.e., cannot be recovered from) and whether a retry might be possible.
*
* @class HMSException
* @property {number} code - Numeric error code representing the type of error.
* @property {string} description - A brief, human-readable description of the error.
* @property {string} [message] - Additional message information about the error (Android only).
* @property {string} [name] - The name of the error (Android only).
* @property {string} [action] - The action during which the error occurred (Android only).
* @property {boolean} isTerminal - Indicates whether the error is terminal.
* @property {boolean} [canRetry] - Indicates whether the operation that caused the error can be retried (Android only).
*
*/
export class HMSException {
code: number;
description: string;
Expand Down
15 changes: 15 additions & 0 deletions packages/react-native-hms/src/classes/HMSIOSAudioMode.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* Enum for specifying the audio mode in an iOS environment within a 100ms (HMS) application.
*
* This enumeration provides options to configure the audio mode for an iOS application using the 100ms (HMS) SDK.
* It allows for the selection between `voice` and `music` modes, catering to different use cases such as
* prioritizing voice clarity or enhancing music quality during a session.
*
* @enum {string}
* @property {string} VOICE - Configures the audio session for optimized voice communication.
* This mode enhances voice clarity, making it suitable for calls or conferences.
* @property {string} MUSIC - Configures the audio session for music playback.
* This mode enhances music fidelity, making it suitable for streams or recordings that prioritize music quality.
*
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/microphone/music-mode
*/
export enum HMSIOSAudioMode {
VOICE = 'voice',
MUSIC = 'music',
Expand Down
12 changes: 12 additions & 0 deletions packages/react-native-hms/src/classes/HMSLogAlarmManager.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/**
* Enumeration for managing log alarm settings in HMS SDK for React Native applications. Android only.
*
* This enumeration defines constants used to configure the alarm manager for log files in the HMS SDK.
* It includes settings for the default directory size, default log file name, and maximum directory size,
* allowing for detailed control over how log files are managed and stored.
*
* @enum {string}
* @property {string} DEFAULT_DIR_SIZE - Represents the default size for the log directory.
* @property {string} DEFAULT_LOGS_FILE_NAME - Represents the default name for log files.
* @property {string} MAX_DIR_SIZE - Represents the maximum size for the log directory.
*/
export enum HMSLogAlarmManager {
DEFAULT_DIR_SIZE = 'DEFAULT_DIR_SIZE',
DEFAULT_LOGS_FILE_NAME = 'DEFAULT_LOGS_FILE_NAME',
Expand Down
12 changes: 12 additions & 0 deletions packages/react-native-hms/src/classes/HMSLogLevel.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/**
* Enumeration for defining log levels in the HMS SDK for React Native applications.
*
* This enumeration provides a set of predefined log levels that can be used to control the verbosity of logging
* within the HMS SDK. It allows developers to specify how much detail they want in their logs, which can be
* helpful for debugging or monitoring the application's behavior.
*
* @enum {string}
* @property {string} VERBOSE - Represents the most verbose log level, including detailed debug information.
* @property {string} WARNING - Represents a log level for warning messages that might indicate potential issues.
* @property {string} ERROR - Represents a log level for error messages indicating failures that need attention.
*/
export enum HMSLogLevel {
VERBOSE = 'VERBOSE',
WARNING = 'WARNING',
Expand Down
14 changes: 14 additions & 0 deletions packages/react-native-hms/src/classes/HMSLogSettings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
import type { HMSLogAlarmManager } from './HMSLogAlarmManager';
import type { HMSLogLevel } from './HMSLogLevel';

/**
* Represents the logging settings for the HMS SDK.
*
* This class encapsulates the settings related to logging within the HMS SDK, including the log level,
* whether log storage is enabled, and the maximum directory size for log storage.
* It is used to configure how logs are handled by the SDK, allowing for customization of log verbosity and storage requirements.
*
* @class HMSLogSettings
* @property {HMSLogLevel} level - The log level setting, determining the verbosity of the logs.
* @property {boolean} isLogStorageEnabled - Flag indicating whether log storage is enabled. Android only.
* @property {HMSLogAlarmManager} maxDirSizeInBytes - The maximum size of the log directory in bytes, managed by an instance of HMSLogAlarmManager. Android only.
*
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/debugging/logger
*/
export class HMSLogSettings {
level: HMSLogLevel;
isLogStorageEnabled: boolean;
Expand Down
18 changes: 18 additions & 0 deletions packages/react-native-hms/src/classes/HMSPIPListenerActions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
/**
* Enum for HMS Picture-in-Picture (PIP) Listener Actions.
*
* This enum defines the types of actions/events related to the Picture-in-Picture (PIP) mode that can be listened to
* within the HMS SDK. These actions allow the application to respond to changes in PIP mode or when the room is left
* while in PIP mode.
*
* @enum {string}
*/
export enum HMSPIPListenerActions {
/**
* Action triggered when the Picture-in-Picture mode changes.
* This can be used to handle UI changes or other logic when entering or exiting PIP mode.
*/
ON_PIP_MODE_CHANGED = 'ON_PIP_MODE_CHANGED',

/**
* Action triggered when the room is left while in Picture-in-Picture mode. Android only.
* This can be used to clean up resources or update the UI accordingly.
*/
ON_PIP_ROOM_LEAVE = 'ON_PIP_ROOM_LEAVE',
}
Loading
Loading