@cometchat/calls-sdk-react-native 4.0.0-beta1
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 +27 -0
- package/android/build.gradle +20 -0
- package/android/src/main/AndroidManifest.xml +8 -0
- package/android/src/main/java/com/CometChatCalls/AudioDeviceHandlerGeneric.java +213 -0
- package/android/src/main/java/com/CometChatCalls/AudioDeviceHandlerLegacy.java +213 -0
- package/android/src/main/java/com/CometChatCalls/AudioModeModule.java +456 -0
- package/android/src/main/java/com/CometChatCalls/BluetoothHeadsetMonitor.java +174 -0
- package/android/src/main/java/com/CometChatCalls/CometChatCallsPackage.java +45 -0
- package/cometchat-calls-sdk-react-native.podspec +21 -0
- package/dist/CometChatErrorConstants.d.ts +124 -0
- package/dist/Constants.d.ts +720 -0
- package/dist/Helper copy.d.ts +1 -0
- package/dist/Helper.d.ts +7 -0
- package/dist/api/APIHandler.d.ts +6 -0
- package/dist/api/endpoints.d.ts +6 -0
- package/dist/api/helper.d.ts +63 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/constants/CallConstants.d.ts +136 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/defaultCallsettings.d.ts +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +128 -0
- package/dist/models/CallAppSettings.d.ts +42 -0
- package/dist/models/CallSettings.d.ts +316 -0
- package/dist/models/CometChatCalls.d.ts +89 -0
- package/dist/models/CometChatCallsComponent.d.ts +13 -0
- package/dist/models/CometChatCallsComponentCore.d.ts +18 -0
- package/dist/models/CometChatCallsException.d.ts +7 -0
- package/dist/models/CometChatPresenterComponent.d.ts +13 -0
- package/dist/models/ErrorModel.d.ts +11 -0
- package/dist/models/Listner.d.ts +64 -0
- package/dist/models/ListnerHandler.d.ts +10 -0
- package/dist/models/MessageComponent.d.ts +7 -0
- package/dist/models/PresenterSettings.d.ts +194 -0
- package/dist/models/RTCUser.d.ts +18 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/types/ICallAppSettings.d.ts +6 -0
- package/dist/types/ICallSettings.d.ts +60 -0
- package/dist/types/RTCUser.d.ts +6 -0
- package/dist/types/callEvents.d.ts +53 -0
- package/dist/types/common.d.ts +17 -0
- package/dist/types/index.d.ts +2 -0
- package/ios/AudioMode.h +11 -0
- package/ios/AudioMode.m +403 -0
- package/ios/JitsiAudioSession+Private.h +25 -0
- package/ios/JitsiAudioSession.h +17 -0
- package/ios/JitsiAudioSession.m +34 -0
- package/ios/LogUtils.h +23 -0
- package/ios/react-native-calls2.xcodeproj/project.pbxproj +269 -0
- package/package.json +122 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { OngoingCallListener } from './Listner';
|
|
2
|
+
import { CallConstants } from '../Constants';
|
|
3
|
+
export declare class PresenterSettings {
|
|
4
|
+
static readonly POSITION_TOP_LEFT = "top-left";
|
|
5
|
+
static readonly POSITION_TOP_RIGHT = "top-right";
|
|
6
|
+
static readonly POSITION_BOTTOM_LEFT = "bottom-left";
|
|
7
|
+
static readonly POSITION_BOTTOM_RIGHT = "bottom-right";
|
|
8
|
+
static readonly ASPECT_RATIO_DEFAULT = "default";
|
|
9
|
+
static readonly ASPECT_RATIO_CONTAIN = "contain";
|
|
10
|
+
static readonly ASPECT_RATIO_COVER = "cover";
|
|
11
|
+
static readonly POSITION: {
|
|
12
|
+
readonly TOP_LEFT: "top-left";
|
|
13
|
+
readonly TOP_RIGHT: "top-right";
|
|
14
|
+
readonly BOTTOM_LEFT: "bottom-left";
|
|
15
|
+
readonly BOTTOM_RIGHT: "bottom-right";
|
|
16
|
+
};
|
|
17
|
+
static readonly ASPECT_RATIO: {
|
|
18
|
+
readonly DEFAULT: "default";
|
|
19
|
+
readonly CONTAIN: "contain";
|
|
20
|
+
readonly COVER: "cover";
|
|
21
|
+
};
|
|
22
|
+
private defaultLayout;
|
|
23
|
+
private isAudioOnly;
|
|
24
|
+
private isPresenter;
|
|
25
|
+
private listener;
|
|
26
|
+
private ShowEndCallButton;
|
|
27
|
+
private ShowSwitchCameraButton;
|
|
28
|
+
private ShowMuteAudioButton;
|
|
29
|
+
private ShowPauseVideoButton;
|
|
30
|
+
private ShowAudioModeButton;
|
|
31
|
+
private StartAudioMuted;
|
|
32
|
+
private StartVideoMuted;
|
|
33
|
+
private defaultAudioMode;
|
|
34
|
+
private ShowRecordingButton;
|
|
35
|
+
constructor(builder: PresenterSettingsBuilder);
|
|
36
|
+
isAudioOnlyCall(): boolean;
|
|
37
|
+
getIsPresenter(): boolean;
|
|
38
|
+
isDefaultLayoutEnabled(): boolean;
|
|
39
|
+
getCallEventListener(): OngoingCallListener;
|
|
40
|
+
isEndCallButtonEnabled(): boolean;
|
|
41
|
+
isSwitchCameraButtonEnabled(): boolean;
|
|
42
|
+
isMuteAudioButtonEnabled(): boolean;
|
|
43
|
+
isPauseVideoButtonEnabled(): boolean;
|
|
44
|
+
isAudioModeButtonEnabled(): boolean;
|
|
45
|
+
getStartWithAudioMuted(): boolean;
|
|
46
|
+
getStartWithVideoMuted(): boolean;
|
|
47
|
+
getDefaultAudioMode(): string;
|
|
48
|
+
isRecordingButtonEnabled(): boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare class PresenterSettingsBuilder {
|
|
51
|
+
/** @private */ defaultLayout: boolean;
|
|
52
|
+
/** @private */ isAudioOnly: boolean;
|
|
53
|
+
/** @private */ isPresenter: boolean;
|
|
54
|
+
/** @private */ listener: OngoingCallListener;
|
|
55
|
+
/** @private */ ShowEndCallButton: boolean;
|
|
56
|
+
/** @private */ ShowSwitchCameraButton: boolean;
|
|
57
|
+
/** @private */ ShowMuteAudioButton: boolean;
|
|
58
|
+
/** @private */ ShowPauseVideoButton: boolean;
|
|
59
|
+
/** @private */ ShowAudioModeButton: boolean;
|
|
60
|
+
/** @private */ StartAudioMuted: boolean;
|
|
61
|
+
/** @private */ StartVideoMuted: boolean;
|
|
62
|
+
/** @private */ defaultAudioMode: typeof CallConstants.AUDIO_MODE[keyof typeof CallConstants.AUDIO_MODE];
|
|
63
|
+
/** @private */ ShowRecordingButton: boolean;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @param {boolean} defaultLayout
|
|
67
|
+
* This methods shows/hides the default button layout.
|
|
68
|
+
* If set to true the default button layout will be shown.
|
|
69
|
+
* If set to false the default button layout will be hidden.
|
|
70
|
+
* Default value is true
|
|
71
|
+
* @returns
|
|
72
|
+
*/
|
|
73
|
+
enableDefaultLayout(defaultLayout: boolean): this;
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* @param {boolean} isAudioOnly
|
|
77
|
+
* This methods sets the type(audio/video) of the call.
|
|
78
|
+
* If set to true, the call will be strictly an audio call.
|
|
79
|
+
* If set to false, the call will be an audio-video call.
|
|
80
|
+
* Default value is false
|
|
81
|
+
* @returns
|
|
82
|
+
*/
|
|
83
|
+
setIsAudioOnlyCall(isAudioOnly: boolean): this;
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
* @param {boolean} isPresenter
|
|
87
|
+
* This methods sets if the user is a presenter.
|
|
88
|
+
* If set to true, the user will be a presenter (allowed to share video/audio).
|
|
89
|
+
* If set to false, the user will not be a presenter (restricted).
|
|
90
|
+
* Default value is false
|
|
91
|
+
* @returns
|
|
92
|
+
*/
|
|
93
|
+
setIsPresenter(isPresenter: boolean): this;
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* @param {OngoingCallListener} listener
|
|
97
|
+
* This method sets the call event listener.
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
100
|
+
setCallEventListener(listener: OngoingCallListener): this;
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
* @param {boolean} showEndCallButton
|
|
104
|
+
* This method shows/hides the end call button.
|
|
105
|
+
* If set to true it will display the end call button.
|
|
106
|
+
* If set to false it will hide the end call button.
|
|
107
|
+
* Default value is true.
|
|
108
|
+
* @returns
|
|
109
|
+
*/
|
|
110
|
+
showEndCallButton(showEndCallButton?: boolean): this;
|
|
111
|
+
/**
|
|
112
|
+
*
|
|
113
|
+
* @param {boolean} showSwitchCameraButton
|
|
114
|
+
* This method shows/hides the switch camera button.
|
|
115
|
+
* If set to true it will display the switch camera button.
|
|
116
|
+
* If set to false it will hide the switch camera button.
|
|
117
|
+
* Note: For video call it remains hidden regardless of its value.
|
|
118
|
+
* Default value is true.
|
|
119
|
+
* @returns
|
|
120
|
+
*/
|
|
121
|
+
showSwitchCameraButton(showSwitchCameraButton?: boolean): this;
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
* @param {boolean} showMuteAudioButton
|
|
125
|
+
* This method shows/hides the mute audio button.
|
|
126
|
+
* If set to true it will display the mute audio button.
|
|
127
|
+
* If set to false it will hide the mute audio button.
|
|
128
|
+
* Default value is true.
|
|
129
|
+
* @returns
|
|
130
|
+
*/
|
|
131
|
+
showMuteAudioButton(showMuteAudioButton?: boolean): this;
|
|
132
|
+
/**
|
|
133
|
+
*
|
|
134
|
+
* @param {boolean} showPauseVideoButton
|
|
135
|
+
* This method shows/hides the pause video button.
|
|
136
|
+
* If set to true it will display the pause video button.
|
|
137
|
+
* If set to false it will hide the pause video button.
|
|
138
|
+
* Note: For video call it remains hidden regardless of its value.
|
|
139
|
+
* Default value is true.
|
|
140
|
+
* @returns
|
|
141
|
+
*/
|
|
142
|
+
showPauseVideoButton(showPauseVideoButton?: boolean): this;
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* @param {boolean} showAudioModeButton
|
|
146
|
+
* This method shows/hides the audio mode button.
|
|
147
|
+
* If set to true it will display the audio mode button.
|
|
148
|
+
* If set to false it will hide the audio mode button.
|
|
149
|
+
* Default value is true.
|
|
150
|
+
* @returns
|
|
151
|
+
*/
|
|
152
|
+
showAudioModeButton(showAudioModeButton?: boolean): this;
|
|
153
|
+
/**
|
|
154
|
+
*
|
|
155
|
+
* @param {boolean} audioMuted
|
|
156
|
+
* This method allows the call to be started with audio muted.
|
|
157
|
+
* If set to true, the call will start with audio muted.
|
|
158
|
+
* Default value is false.
|
|
159
|
+
* @returns
|
|
160
|
+
*/
|
|
161
|
+
startWithAudioMuted(audioMuted?: boolean): this;
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
* @param {boolean} videoMuted
|
|
165
|
+
* This method allows the call to be started with video muted.
|
|
166
|
+
* If set to true, the call will start with video muted.
|
|
167
|
+
* Note: This method has no effect for audio calls.
|
|
168
|
+
* Default value is false.
|
|
169
|
+
* @returns
|
|
170
|
+
*/
|
|
171
|
+
startWithVideoMuted(videoMuted?: boolean): this;
|
|
172
|
+
/**
|
|
173
|
+
*
|
|
174
|
+
* @param {string} audioMode
|
|
175
|
+
* This method will set the default audio mode.
|
|
176
|
+
* @returns
|
|
177
|
+
*/
|
|
178
|
+
setDefaultAudioMode(audioMode: typeof CallConstants.AUDIO_MODE[keyof typeof CallConstants.AUDIO_MODE]): this;
|
|
179
|
+
/**
|
|
180
|
+
*
|
|
181
|
+
* @param {boolean} showRecordingButton
|
|
182
|
+
* This method shows/hides the recording button.
|
|
183
|
+
* If set to true it will display the recording button.
|
|
184
|
+
* If set to false it will hide the recording button.
|
|
185
|
+
* Default value is false.
|
|
186
|
+
* @returns
|
|
187
|
+
*/
|
|
188
|
+
showRecordingButton(showRecordingButton?: boolean): this;
|
|
189
|
+
/**
|
|
190
|
+
* This method will return an object of the CallSettings class.
|
|
191
|
+
* @returns {PresenterSettings}
|
|
192
|
+
*/
|
|
193
|
+
build(): PresenterSettings;
|
|
194
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class RTCUser {
|
|
2
|
+
private uid;
|
|
3
|
+
private avatar;
|
|
4
|
+
private name;
|
|
5
|
+
private jwt;
|
|
6
|
+
private resource;
|
|
7
|
+
constructor(uid: string);
|
|
8
|
+
setUID(uid: string): void;
|
|
9
|
+
getUID(): string;
|
|
10
|
+
setName(name: string): void;
|
|
11
|
+
getName(): string;
|
|
12
|
+
setAvatar(avatar: string): void;
|
|
13
|
+
getAvatar(): string;
|
|
14
|
+
setJWT(jwt: string): void;
|
|
15
|
+
getJWT(): string;
|
|
16
|
+
setResource(resource: string): void;
|
|
17
|
+
getResource(): string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ListenerHandlers } from "./ListnerHandler";
|
|
2
|
+
export declare const addCallEventListener: typeof ListenerHandlers.addCallEventListener;
|
|
3
|
+
export declare const removeCallEventListener: typeof ListenerHandlers.removeCallEventListener;
|
|
4
|
+
export * from "./CallAppSettings";
|
|
5
|
+
export * from "./CometChatCalls";
|
|
6
|
+
export * from "./ErrorModel";
|
|
7
|
+
export * from "./RTCUser";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ColorValue, Position } from "./common";
|
|
2
|
+
export interface ICallSettings {
|
|
3
|
+
screenShareMode?: "default" | "presenter";
|
|
4
|
+
ShowEndCallButton?: boolean;
|
|
5
|
+
ShowRecordingButton?: boolean;
|
|
6
|
+
StartRecordingOnCallStart?: boolean;
|
|
7
|
+
ShowMuteAudioButton?: boolean;
|
|
8
|
+
ShowPauseVideoButton?: boolean;
|
|
9
|
+
ShowScreenShareButton?: boolean;
|
|
10
|
+
ShowSwitchToVideoCallButton?: boolean;
|
|
11
|
+
defaultLayout?: boolean;
|
|
12
|
+
isAudioCall?: boolean;
|
|
13
|
+
isAudioOnly?: boolean;
|
|
14
|
+
user: {
|
|
15
|
+
name: string;
|
|
16
|
+
avatar?: string;
|
|
17
|
+
uid: string;
|
|
18
|
+
jwt?: string;
|
|
19
|
+
};
|
|
20
|
+
mode?: "DEFAULT" | "SPOTLIGHT" | "TILE" | "SIDEBAR";
|
|
21
|
+
StartAudioMuted?: boolean;
|
|
22
|
+
StartVideoMuted?: boolean;
|
|
23
|
+
ShowSwitchModeButton?: boolean;
|
|
24
|
+
ShowVirtualBackgroundSetting?: boolean;
|
|
25
|
+
VirtualBackground?: {
|
|
26
|
+
AllowBackgroundBlur?: boolean;
|
|
27
|
+
AllowUserImages?: boolean;
|
|
28
|
+
ShowDefaultImages?: boolean;
|
|
29
|
+
SetImages?: string[];
|
|
30
|
+
EnforceBackgroundBlur?: 0 | 1 | 2;
|
|
31
|
+
EnforceBackgroundImage?: string;
|
|
32
|
+
};
|
|
33
|
+
AvatarMode?: "circle";
|
|
34
|
+
MainVideoContainerSetting?: {
|
|
35
|
+
videoFit?: "contain" | "cover";
|
|
36
|
+
zoomButton?: {
|
|
37
|
+
visible?: boolean;
|
|
38
|
+
visibility?: boolean;
|
|
39
|
+
position?: Position;
|
|
40
|
+
};
|
|
41
|
+
nameLabel?: {
|
|
42
|
+
visible?: boolean;
|
|
43
|
+
visibility?: boolean;
|
|
44
|
+
position?: Position;
|
|
45
|
+
color?: ColorValue;
|
|
46
|
+
};
|
|
47
|
+
network?: {
|
|
48
|
+
visible?: boolean;
|
|
49
|
+
visibility?: boolean;
|
|
50
|
+
position?: Position;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
customCSS?: string;
|
|
54
|
+
analyticsSettings?: {
|
|
55
|
+
ANALYTICS_HOST: string;
|
|
56
|
+
ANALYTICS_VERSION: string;
|
|
57
|
+
ANALYTICS_PING_DISABLED: boolean;
|
|
58
|
+
ANALYTICS_USE_SSL: boolean;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
interface User {
|
|
2
|
+
name: string;
|
|
3
|
+
avatar: string;
|
|
4
|
+
isVideoMuted: string;
|
|
5
|
+
isAudioMuted: string;
|
|
6
|
+
isLocalUser: string;
|
|
7
|
+
id: string;
|
|
8
|
+
uid: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ICallEventsData {
|
|
11
|
+
readonly onUserJoined: {
|
|
12
|
+
name: string;
|
|
13
|
+
avatar: string;
|
|
14
|
+
joinnedAt: string;
|
|
15
|
+
uid: string;
|
|
16
|
+
isAudioMuted: boolean;
|
|
17
|
+
isLocalUser: boolean;
|
|
18
|
+
isVideoMuted: boolean;
|
|
19
|
+
};
|
|
20
|
+
readonly onUserLeft: {
|
|
21
|
+
name: string;
|
|
22
|
+
avatar: string;
|
|
23
|
+
joinnedAt: string;
|
|
24
|
+
uid: string;
|
|
25
|
+
};
|
|
26
|
+
readonly onUserListUpdated: Array<{
|
|
27
|
+
name: string;
|
|
28
|
+
avatar: string;
|
|
29
|
+
uid: string;
|
|
30
|
+
}>;
|
|
31
|
+
readonly onMediaDeviceListUpdated: {
|
|
32
|
+
videoInputDevices: MediaDeviceInfo[];
|
|
33
|
+
audioInputDevices: MediaDeviceInfo[];
|
|
34
|
+
audioOutputDevices: MediaDeviceInfo[];
|
|
35
|
+
};
|
|
36
|
+
readonly onRecordingStarted: Partial<User & {
|
|
37
|
+
recordId: string;
|
|
38
|
+
}>;
|
|
39
|
+
readonly onRecordingStopped: Partial<User & {
|
|
40
|
+
recordId: string;
|
|
41
|
+
}>;
|
|
42
|
+
readonly onCallSwitchedToVideo: {
|
|
43
|
+
sessionId: string;
|
|
44
|
+
initiator: Partial<User>;
|
|
45
|
+
};
|
|
46
|
+
readonly onCallEnded: {};
|
|
47
|
+
readonly onUserMuted: {
|
|
48
|
+
name: string;
|
|
49
|
+
avatar: string;
|
|
50
|
+
uid: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CallSettings } from "../models/CallSettings";
|
|
2
|
+
export type Position = typeof CallSettings.POSITION[keyof typeof CallSettings.POSITION];
|
|
3
|
+
export type AspectRatio = typeof CallSettings.ASPECT_RATIO[keyof typeof CallSettings.ASPECT_RATIO];
|
|
4
|
+
export type ColorRGB = `rgb(${number}, ${number}, ${number})`;
|
|
5
|
+
export type ColorRGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
|
|
6
|
+
export type ColorHEX = `#${string}`;
|
|
7
|
+
type _ColorValue = ColorRGB | ColorRGBA | ColorHEX;
|
|
8
|
+
export type ColorValue = _ColorValue | Omit<string, _ColorValue>;
|
|
9
|
+
type _Region = "eu" | "us" | "in";
|
|
10
|
+
export type Region = _Region | Omit<string, _Region>;
|
|
11
|
+
type _THost = `rtc-${_Region}.cometchat.io`;
|
|
12
|
+
export type Host = _THost | Omit<string, _THost>;
|
|
13
|
+
export interface AudioMode {
|
|
14
|
+
isSelected: boolean;
|
|
15
|
+
mode: string;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
package/ios/AudioMode.h
ADDED