@cometchat/calls-sdk-react-native 4.1.1 → 4.2.1

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.
@@ -35,6 +35,7 @@ export declare class CallSettings {
35
35
  private ShowSwitchToVideoCallButton;
36
36
  private AvatarMode;
37
37
  private ShowRecordingButton;
38
+ private idleTimeoutPeriod;
38
39
  private StartRecordingOnCallStart;
39
40
  private MainVideoContainerSetting;
40
41
  private EnableVideoTileClick;
@@ -55,6 +56,7 @@ export declare class CallSettings {
55
56
  isAudioToVideoButtonEnabled(): boolean;
56
57
  getAvatarMode(): string;
57
58
  isRecordingButtonEnabled(): boolean;
59
+ getIdleTimeoutPeriod(): number;
58
60
  shouldStartRecordingOnCallStart(): boolean;
59
61
  getMainVideoContainerSetting(): MainVideoContainerSetting;
60
62
  isVideoTileClickEnabled(): boolean;
@@ -77,6 +79,7 @@ export declare class CallSettingsBuilder {
77
79
  /** @private */ ShowSwitchToVideoCallButton: boolean;
78
80
  /** @private */ AvatarMode: string;
79
81
  /** @private */ ShowRecordingButton: boolean;
82
+ /** @private */ idleTimeoutPeriod: number;
80
83
  /** @private */ StartRecordingOnCallStart: boolean;
81
84
  /** @private */ MainVideoContainerSetting: MainVideoContainerSetting;
82
85
  /** @private */ EnableVideoTileClick: boolean;
@@ -223,6 +226,17 @@ export declare class CallSettingsBuilder {
223
226
  * @returns
224
227
  */
225
228
  showRecordingButton(showRecordingButton?: boolean): this;
229
+ /**
230
+ *
231
+ * @param {number} idleTimeoutPeriod
232
+ * This method sets the idle timeout period for the call.
233
+ * If set and you are the only one in call, the call will end
234
+ * after the idle timeout period, giving you the option to
235
+ * extend the call 60 seconds before the call ends.
236
+ * Default value is 180 seconds.
237
+ * @returns
238
+ */
239
+ setIdleTimeoutPeriod(idleTimeoutPeriod?: number): this;
226
240
  /**
227
241
  *
228
242
  * @param {boolean} startRecordingOnCallStart
@@ -10,6 +10,7 @@ interface IOngoingCallListener {
10
10
  onUserMuted: (test: Partial<ICallEventsData["onUserMuted"]>) => void;
11
11
  onCallSwitchedToVideo: (data: Partial<ICallEventsData['onCallSwitchedToVideo']>) => void;
12
12
  onCallEnded: () => void;
13
+ onSessionTimeout: () => void;
13
14
  onCallEndButtonPressed: () => void;
14
15
  onAudioModesUpdated: (any: any) => void;
15
16
  onError: (error: CometChatCallsException) => void;
@@ -35,6 +36,10 @@ export declare class OngoingCallListener {
35
36
  * This event is triggered when the call is ended.
36
37
  */
37
38
  onCallEnded?: IOngoingCallListener["onCallEnded"];
39
+ /**
40
+ * This event is triggered when the call is ended due to session timeout.
41
+ */
42
+ onSessionTimeout?: IOngoingCallListener["onSessionTimeout"];
38
43
  /**
39
44
  * This event is triggered when end call button is pressed.
40
45
  */
@@ -32,6 +32,7 @@ export declare class PresenterSettings {
32
32
  private StartVideoMuted;
33
33
  private defaultAudioMode;
34
34
  private ShowRecordingButton;
35
+ private idleTimeoutPeriod;
35
36
  constructor(builder: PresenterSettingsBuilder);
36
37
  isAudioOnlyCall(): boolean;
37
38
  getIsPresenter(): boolean;
@@ -46,6 +47,7 @@ export declare class PresenterSettings {
46
47
  getStartWithVideoMuted(): boolean;
47
48
  getDefaultAudioMode(): string;
48
49
  isRecordingButtonEnabled(): boolean;
50
+ getIdleTimeoutPeriod(): number;
49
51
  }
50
52
  export declare class PresenterSettingsBuilder {
51
53
  /** @private */ defaultLayout: boolean;
@@ -61,6 +63,7 @@ export declare class PresenterSettingsBuilder {
61
63
  /** @private */ StartVideoMuted: boolean;
62
64
  /** @private */ defaultAudioMode: typeof CallConstants.AUDIO_MODE[keyof typeof CallConstants.AUDIO_MODE];
63
65
  /** @private */ ShowRecordingButton: boolean;
66
+ /** @private */ idleTimeoutPeriod: number;
64
67
  /**
65
68
  *
66
69
  * @param {boolean} defaultLayout
@@ -186,6 +189,17 @@ export declare class PresenterSettingsBuilder {
186
189
  * @returns
187
190
  */
188
191
  showRecordingButton(showRecordingButton?: boolean): this;
192
+ /**
193
+ *
194
+ * @param {number} idleTimeoutPeriod
195
+ * This method sets the idle timeout period for the call.
196
+ * If set and you are the only one in call, the call will end
197
+ * after the idle timeout period, giving you the option to
198
+ * extend the call 60 seconds before the call ends.
199
+ * Default value is 180 seconds.
200
+ * @returns
201
+ */
202
+ setIdleTimeoutPeriod(idleTimeoutPeriod: number): this;
189
203
  /**
190
204
  * This method will return an object of the CallSettings class.
191
205
  * @returns {PresenterSettings}
@@ -3,6 +3,7 @@ export interface ICallSettings {
3
3
  screenShareMode?: "default" | "presenter";
4
4
  ShowEndCallButton?: boolean;
5
5
  ShowRecordingButton?: boolean;
6
+ idleTimeoutPeriod?: number;
6
7
  StartRecordingOnCallStart?: boolean;
7
8
  ShowMuteAudioButton?: boolean;
8
9
  ShowPauseVideoButton?: boolean;
@@ -44,6 +44,7 @@ export interface ICallEventsData {
44
44
  initiator: Partial<User>;
45
45
  };
46
46
  readonly onCallEnded: {};
47
+ readonly onSessionTimeout: () => void;
47
48
  readonly onUserMuted: {
48
49
  name: string;
49
50
  avatar: string;
@@ -0,0 +1,6 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTEventEmitter.h>
3
+
4
+ @interface CometChatCommonModule : NSObject <RCTBridgeModule>
5
+ + (UIInterfaceOrientationMask)getOrientation;
6
+ @end
@@ -0,0 +1,29 @@
1
+ #import "CometChatCommonModule.h"
2
+ #import <UIKit/UIKit.h>
3
+
4
+ @implementation CometChatCommonModule {
5
+ }
6
+
7
+ RCT_EXPORT_MODULE();
8
+
9
+
10
+ static UIInterfaceOrientationMask _orientationMask = UIInterfaceOrientationMaskAll;
11
+
12
+ + (void)setOrientation: (UIInterfaceOrientationMask)orientationMask {
13
+ _orientationMask = orientationMask;
14
+ }
15
+
16
+ + (UIInterfaceOrientationMask)getOrientation {
17
+ return _orientationMask;
18
+ }
19
+
20
+ RCT_EXPORT_METHOD(lockToPortrait) {
21
+ [CometChatCommonModule setOrientation:UIInterfaceOrientationMaskPortrait];
22
+ [UIViewController attemptRotationToDeviceOrientation];
23
+ }
24
+
25
+ RCT_EXPORT_METHOD(unlockAllOrientations) {
26
+ [CometChatCommonModule setOrientation:UIInterfaceOrientationMaskAll];
27
+ }
28
+
29
+ @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cometchat/calls-sdk-react-native",
3
- "version": "4.1.1",
3
+ "version": "4.2.1",
4
4
  "description": "Cometchat React Native Calling component for iOS and Android",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",