@100mslive/react-native-hms 1.4.0 → 1.6.0
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/android/build.gradle +3 -2
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +189 -55
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +1 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +94 -38
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +446 -107
- package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManager.kt +5 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSView.kt +42 -25
- package/android/src/main/res/layout/hms_view.xml +2 -2
- package/ios/HMSConstants.swift +33 -0
- package/ios/HMSDecoder.swift +372 -157
- package/ios/HMSHelper.swift +44 -7
- package/ios/HMSManager.m +17 -2
- package/ios/HMSManager.swift +177 -75
- package/ios/HMSRNSDK.swift +641 -199
- package/ios/HMSView.m +1 -0
- package/ios/HMSView.swift +21 -19
- package/lib/commonjs/classes/HMSAudioTrackSettings.js +14 -0
- package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSCameraControl.js +28 -0
- package/lib/commonjs/classes/HMSCameraControl.js.map +1 -0
- package/lib/commonjs/classes/HMSEncoder.js +97 -14
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSIOSAudioMode.js +13 -0
- package/lib/commonjs/classes/HMSIOSAudioMode.js.map +1 -0
- package/lib/commonjs/classes/HMSLayer.js +14 -0
- package/lib/commonjs/classes/HMSLayer.js.map +1 -0
- package/lib/commonjs/classes/HMSLocalVideoStats.js +11 -0
- package/lib/commonjs/classes/HMSLocalVideoStats.js.map +1 -1
- package/lib/commonjs/classes/HMSPeer.js +1 -1
- package/lib/commonjs/classes/HMSPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSPublishSettings.js +2 -0
- package/lib/commonjs/classes/HMSPublishSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSQualityLimitationReason.js +16 -0
- package/lib/commonjs/classes/HMSQualityLimitationReason.js.map +1 -0
- package/lib/commonjs/classes/HMSQualityLimitationReasons.js +27 -0
- package/lib/commonjs/classes/HMSQualityLimitationReasons.js.map +1 -0
- package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoTrack.js +39 -3
- package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRoom.js +4 -0
- package/lib/commonjs/classes/HMSRoom.js.map +1 -1
- package/lib/commonjs/classes/HMSRoomUpdate.js +1 -0
- package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +82 -45
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js +173 -0
- package/lib/commonjs/classes/HMSSessionStore.js.map +1 -0
- package/lib/commonjs/classes/HMSSimulcastLayerDefinition.js +19 -0
- package/lib/commonjs/classes/HMSSimulcastLayerDefinition.js.map +1 -0
- package/lib/commonjs/classes/HMSSimulcastLayerSettingsPolicy.js +23 -0
- package/lib/commonjs/classes/HMSSimulcastLayerSettingsPolicy.js.map +1 -0
- package/lib/commonjs/classes/HMSSimulcastSettings.js +5 -4
- package/lib/commonjs/classes/HMSSimulcastSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSSimulcastSettingsPolicy.js +17 -0
- package/lib/commonjs/classes/HMSSimulcastSettingsPolicy.js.map +1 -0
- package/lib/commonjs/classes/HMSSubscribeDegradationPolicy.js +21 -0
- package/lib/commonjs/classes/HMSSubscribeDegradationPolicy.js.map +1 -0
- package/lib/commonjs/classes/HMSSubscribeSettings.js +2 -0
- package/lib/commonjs/classes/HMSSubscribeSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSUpdateListenerActions.js +8 -0
- package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoResolution.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrackSettings.js +5 -0
- package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +2 -0
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/index.js +72 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/emitter/EventEmitter.js +162 -0
- package/lib/commonjs/utils/emitter/EventEmitter.js.map +1 -0
- package/lib/commonjs/utils/emitter/_EmitterSubscription.js +46 -0
- package/lib/commonjs/utils/emitter/_EmitterSubscription.js.map +1 -0
- package/lib/commonjs/utils/emitter/_EventSubscription.js +36 -0
- package/lib/commonjs/utils/emitter/_EventSubscription.js.map +1 -0
- package/lib/commonjs/utils/emitter/_EventSubscriptionVendor.js +90 -0
- package/lib/commonjs/utils/emitter/_EventSubscriptionVendor.js.map +1 -0
- package/lib/commonjs/utils/index.js +17 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/module/classes/HMSAudioTrackSettings.js +14 -0
- package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSCameraControl.js +21 -0
- package/lib/module/classes/HMSCameraControl.js.map +1 -0
- package/lib/module/classes/HMSEncoder.js +97 -14
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSIOSAudioMode.js +6 -0
- package/lib/module/classes/HMSIOSAudioMode.js.map +1 -0
- package/lib/module/classes/HMSLayer.js +7 -0
- package/lib/module/classes/HMSLayer.js.map +1 -0
- package/lib/module/classes/HMSLocalVideoStats.js +11 -0
- package/lib/module/classes/HMSLocalVideoStats.js.map +1 -1
- package/lib/module/classes/HMSPeer.js +1 -1
- package/lib/module/classes/HMSPeer.js.map +1 -1
- package/lib/module/classes/HMSPublishSettings.js +2 -0
- package/lib/module/classes/HMSPublishSettings.js.map +1 -1
- package/lib/module/classes/HMSQualityLimitationReason.js +9 -0
- package/lib/module/classes/HMSQualityLimitationReason.js.map +1 -0
- package/lib/module/classes/HMSQualityLimitationReasons.js +20 -0
- package/lib/module/classes/HMSQualityLimitationReasons.js.map +1 -0
- package/lib/module/classes/HMSRemotePeer.js.map +1 -1
- package/lib/module/classes/HMSRemoteVideoTrack.js +39 -3
- package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSRoom.js +4 -0
- package/lib/module/classes/HMSRoom.js.map +1 -1
- package/lib/module/classes/HMSRoomUpdate.js +1 -0
- package/lib/module/classes/HMSRoomUpdate.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +83 -45
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSSessionStore.js +166 -0
- package/lib/module/classes/HMSSessionStore.js.map +1 -0
- package/lib/module/classes/HMSSimulcastLayerDefinition.js +12 -0
- package/lib/module/classes/HMSSimulcastLayerDefinition.js.map +1 -0
- package/lib/module/classes/HMSSimulcastLayerSettingsPolicy.js +16 -0
- package/lib/module/classes/HMSSimulcastLayerSettingsPolicy.js.map +1 -0
- package/lib/module/classes/HMSSimulcastSettings.js +5 -4
- package/lib/module/classes/HMSSimulcastSettings.js.map +1 -1
- package/lib/module/classes/HMSSimulcastSettingsPolicy.js +10 -0
- package/lib/module/classes/HMSSimulcastSettingsPolicy.js.map +1 -0
- package/lib/module/classes/HMSSubscribeDegradationPolicy.js +14 -0
- package/lib/module/classes/HMSSubscribeDegradationPolicy.js.map +1 -0
- package/lib/module/classes/HMSSubscribeSettings.js +2 -0
- package/lib/module/classes/HMSSubscribeSettings.js.map +1 -1
- package/lib/module/classes/HMSUpdateListenerActions.js +8 -0
- package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/module/classes/HMSVideoResolution.js.map +1 -1
- package/lib/module/classes/HMSVideoTrackSettings.js +5 -0
- package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/module/classes/HmsView.js +2 -0
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/emitter/EventEmitter.js +151 -0
- package/lib/module/utils/emitter/EventEmitter.js.map +1 -0
- package/lib/module/utils/emitter/_EmitterSubscription.js +39 -0
- package/lib/module/utils/emitter/_EmitterSubscription.js.map +1 -0
- package/lib/module/utils/emitter/_EventSubscription.js +29 -0
- package/lib/module/utils/emitter/_EventSubscription.js.map +1 -0
- package/lib/module/utils/emitter/_EventSubscriptionVendor.js +83 -0
- package/lib/module/utils/emitter/_EventSubscriptionVendor.js.map +1 -0
- package/lib/module/utils/index.js +2 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/typescript/classes/HMSAudioTrackSettings.d.ts +14 -0
- package/lib/typescript/classes/HMSCameraControl.d.ts +9 -0
- package/lib/typescript/classes/HMSEncoder.d.ts +13 -1
- package/lib/typescript/classes/HMSIOSAudioMode.d.ts +4 -0
- package/lib/typescript/classes/HMSLayer.d.ts +5 -0
- package/lib/typescript/classes/HMSLocalVideoStats.d.ts +6 -0
- package/lib/typescript/classes/HMSPeer.d.ts +1 -1
- package/lib/typescript/classes/HMSPublishSettings.d.ts +3 -0
- package/lib/typescript/classes/HMSQualityLimitationReason.d.ts +7 -0
- package/lib/typescript/classes/HMSQualityLimitationReasons.d.ts +17 -0
- package/lib/typescript/classes/HMSRemotePeer.d.ts +0 -1
- package/lib/typescript/classes/HMSRemoteVideoTrack.d.ts +6 -2
- package/lib/typescript/classes/HMSRoomUpdate.d.ts +2 -1
- package/lib/typescript/classes/HMSSDK.d.ts +21 -31
- package/lib/typescript/classes/HMSSessionStore.d.ts +63 -0
- package/lib/typescript/classes/HMSSimulcastLayerDefinition.d.ts +10 -0
- package/lib/typescript/classes/HMSSimulcastLayerSettingsPolicy.d.ts +12 -0
- package/lib/typescript/classes/HMSSimulcastSettings.d.ts +7 -3
- package/lib/typescript/classes/HMSSimulcastSettingsPolicy.d.ts +7 -0
- package/lib/typescript/classes/HMSSubscribeDegradationPolicy.d.ts +10 -0
- package/lib/typescript/classes/HMSSubscribeSettings.d.ts +5 -2
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +9 -1
- package/lib/typescript/classes/HMSVideoResolution.d.ts +2 -2
- package/lib/typescript/classes/HMSVideoTrackSettings.d.ts +5 -0
- package/lib/typescript/classes/HmsView.d.ts +2 -2
- package/lib/typescript/index.d.ts +7 -0
- package/lib/typescript/utils/emitter/EventEmitter.d.ts +91 -0
- package/lib/typescript/utils/emitter/_EmitterSubscription.d.ts +29 -0
- package/lib/typescript/utils/emitter/_EventSubscription.d.ts +19 -0
- package/lib/typescript/utils/emitter/_EventSubscriptionVendor.d.ts +44 -0
- package/lib/typescript/utils/index.d.ts +1 -0
- package/package.json +21 -2
- package/sdk-versions.json +3 -3
- package/src/classes/HMSAudioTrackSettings.ts +16 -0
- package/src/classes/HMSCameraControl.ts +21 -0
- package/src/classes/HMSEncoder.ts +126 -11
- package/src/classes/HMSIOSAudioMode.ts +4 -0
- package/src/classes/HMSLayer.ts +5 -0
- package/src/classes/HMSLocalVideoStats.ts +21 -0
- package/src/classes/HMSPeer.ts +1 -1
- package/src/classes/HMSPublishSettings.ts +4 -0
- package/src/classes/HMSQualityLimitationReason.ts +7 -0
- package/src/classes/HMSQualityLimitationReasons.ts +27 -0
- package/src/classes/HMSRemotePeer.ts +0 -1
- package/src/classes/HMSRemoteVideoTrack.ts +52 -4
- package/src/classes/HMSRoom.ts +2 -0
- package/src/classes/HMSRoomUpdate.ts +1 -0
- package/src/classes/HMSSDK.tsx +124 -52
- package/src/classes/HMSSessionStore.ts +209 -0
- package/src/classes/HMSSimulcastLayerDefinition.ts +12 -0
- package/src/classes/HMSSimulcastLayerSettingsPolicy.ts +18 -0
- package/src/classes/HMSSimulcastSettings.ts +12 -3
- package/src/classes/HMSSimulcastSettingsPolicy.ts +9 -0
- package/src/classes/HMSSubscribeDegradationPolicy.ts +15 -0
- package/src/classes/HMSSubscribeSettings.ts +10 -2
- package/src/classes/HMSUpdateListenerActions.ts +8 -0
- package/src/classes/HMSVideoResolution.ts +1 -1
- package/src/classes/HMSVideoTrackSettings.ts +5 -0
- package/src/classes/HmsView.tsx +5 -1
- package/src/index.ts +10 -0
- package/src/utils/emitter/EventEmitter.ts +160 -0
- package/src/utils/emitter/_EmitterSubscription.ts +44 -0
- package/src/utils/emitter/_EventSubscription.ts +28 -0
- package/src/utils/emitter/_EventSubscriptionVendor.ts +89 -0
- package/src/utils/index.ts +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ViewStyle } from 'react-native';
|
|
3
2
|
import { HMSTrackType } from './HMSTrackType';
|
|
4
3
|
import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
|
|
4
|
+
import { HmsComponentProps } from './HmsView';
|
|
5
5
|
import type { HMSConfig } from './HMSConfig';
|
|
6
6
|
import type { HMSLocalPeer } from './HMSLocalPeer';
|
|
7
7
|
import type { HMSRemotePeer } from './HMSRemotePeer';
|
|
@@ -10,7 +10,6 @@ import type { HMSRole } from './HMSRole';
|
|
|
10
10
|
import type { HMSTrack } from './HMSTrack';
|
|
11
11
|
import type { HMSLogger } from './HMSLogger';
|
|
12
12
|
import type { HMSPeer } from './HMSPeer';
|
|
13
|
-
import type { HMSVideoViewMode } from './HMSVideoViewMode';
|
|
14
13
|
import type { HMSTrackSettings } from './HMSTrackSettings';
|
|
15
14
|
import type { HMSRTMPConfig } from './HMSRTMPConfig';
|
|
16
15
|
import type { HMSHLSConfig } from './HMSHLSConfig';
|
|
@@ -20,13 +19,7 @@ import type { HMSAudioMixingMode } from './HMSAudioMixingMode';
|
|
|
20
19
|
import type { HMSLogSettings } from './HMSLogSettings';
|
|
21
20
|
import { HMSMessageType } from './HMSMessageType';
|
|
22
21
|
import { HMSPIPListenerActions } from './HMSPIPListenerActions';
|
|
23
|
-
|
|
24
|
-
trackId: string;
|
|
25
|
-
style?: ViewStyle;
|
|
26
|
-
mirror?: boolean;
|
|
27
|
-
scaleType?: HMSVideoViewMode;
|
|
28
|
-
setZOrderMediaOverlay?: boolean;
|
|
29
|
-
}
|
|
22
|
+
type HmsViewProps = Omit<HmsComponentProps, 'id'>;
|
|
30
23
|
interface PIPConfig {
|
|
31
24
|
aspectRatio?: [number, number];
|
|
32
25
|
endButton?: boolean;
|
|
@@ -56,6 +49,7 @@ export declare class HMSSDK {
|
|
|
56
49
|
private onRemoteAudioStatsDelegate?;
|
|
57
50
|
private onRemoteVideoStatsDelegate?;
|
|
58
51
|
private onAudioDeviceChangedDelegate?;
|
|
52
|
+
private onSessionStoreAvailableDelegate?;
|
|
59
53
|
private onPIPRoomLeaveDelegate?;
|
|
60
54
|
private emitterSubscriptions;
|
|
61
55
|
private constructor();
|
|
@@ -133,6 +127,7 @@ export declare class HMSSDK {
|
|
|
133
127
|
* - The appearance of tile is completely customizable with style prop.
|
|
134
128
|
* - Scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
|
|
135
129
|
* - Mirror to flip the video vertically.
|
|
130
|
+
* - Auto Simulcast to automatically select the best Streaming Quality of track if feature is enabled in Room.
|
|
136
131
|
*
|
|
137
132
|
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/render-video} for more info
|
|
138
133
|
*
|
|
@@ -417,28 +412,6 @@ export declare class HMSSDK {
|
|
|
417
412
|
* @memberof HMSSDK
|
|
418
413
|
*/
|
|
419
414
|
stopScreenshare: () => Promise<any>;
|
|
420
|
-
/**
|
|
421
|
-
* - enableRTCStats sets a boolean in native side which in turn allows several events to be passed
|
|
422
|
-
* through the bridge these events are {@link RTCStatsListener}, {@link onRemoteVideoStatsListener},
|
|
423
|
-
* {@link onRemoteAudioStatsListener}, {@link onLocalAudioStatsListener} and {@link onLocalVideoStatsListener}
|
|
424
|
-
*
|
|
425
|
-
* - These listeners get various dataPoints for current peers and their connectivity to the room
|
|
426
|
-
* such as jitter, latency etc.
|
|
427
|
-
*
|
|
428
|
-
* - currently available for iOS only
|
|
429
|
-
*
|
|
430
|
-
* @memberof HMSSDK
|
|
431
|
-
*/
|
|
432
|
-
enableRTCStats: () => void;
|
|
433
|
-
/**
|
|
434
|
-
* - disable RTCStats sets the same boolean to false that was set true by enableRTCStats.
|
|
435
|
-
* that activates a check which filters out the events acquired in native listeners and don't
|
|
436
|
-
* let them pass through bridge
|
|
437
|
-
*
|
|
438
|
-
* - currently available for iOS only.
|
|
439
|
-
* @memberof HMSSDK
|
|
440
|
-
*/
|
|
441
|
-
disableRTCStats: () => void;
|
|
442
415
|
enableNetworkQualityUpdates: () => void;
|
|
443
416
|
disableNetworkQualityUpdates: () => void;
|
|
444
417
|
/**
|
|
@@ -529,8 +502,22 @@ export declare class HMSSDK {
|
|
|
529
502
|
* @memberof HMSSDK
|
|
530
503
|
*/
|
|
531
504
|
setAudioDeviceChangeListener: (callback: Function) => any;
|
|
505
|
+
/**
|
|
506
|
+
* @deprecated Older SessionMetaData APIs has been deprecated in favour of newer Session Store APIs.
|
|
507
|
+
* You can subscribe to `ON_SESSION_STORE_AVAILABLE` event to get notified when the `HMSSessionStore`
|
|
508
|
+
* is available and use `set` method on `HMSSessionStore` instance
|
|
509
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/}
|
|
510
|
+
*/
|
|
532
511
|
setSessionMetaData: (sessionMetaData: string | null) => Promise<any>;
|
|
512
|
+
/**
|
|
513
|
+
* @deprecated Older SessionMetaData APIs has been deprecated in favour of newer Session Store APIs.
|
|
514
|
+
* You can subscribe to `ON_SESSION_STORE_AVAILABLE` event to get notified when the `HMSSessionStore`
|
|
515
|
+
* is available and use `get` or `addKeyChangeListener` method on `HMSSessionStore` instance
|
|
516
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/}
|
|
517
|
+
*/
|
|
533
518
|
getSessionMetaData: () => Promise<any>;
|
|
519
|
+
getRemoteVideoTrackFromTrackId: (trackId: string) => Promise<import("./HMSRemoteVideoTrack").HMSRemoteVideoTrack>;
|
|
520
|
+
getRemoteAudioTrackFromTrackId: (trackId: string) => Promise<import("./HMSRemoteAudioTrack").HMSRemoteAudioTrack>;
|
|
534
521
|
/**
|
|
535
522
|
* - This is a prototype event listener that takes action and listens for updates related to that particular action
|
|
536
523
|
*
|
|
@@ -590,6 +577,9 @@ export declare class HMSSDK {
|
|
|
590
577
|
device: string;
|
|
591
578
|
audioDevicesList: string[];
|
|
592
579
|
}) => void;
|
|
580
|
+
onSessionStoreAvailableListener: (data: {
|
|
581
|
+
id: string;
|
|
582
|
+
}) => void;
|
|
593
583
|
onPIPRoomLeaveListener: (data: {
|
|
594
584
|
id: string;
|
|
595
585
|
}) => void;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
type Nullable<T> = T | null | undefined;
|
|
2
|
+
export type HMSSessionStoreValue = Nullable<string>;
|
|
3
|
+
/**
|
|
4
|
+
* Session store is a shared realtime key-value store that is accessible by everyone in the room.
|
|
5
|
+
* It can be utilized to implement features such as pinned text, spotlight (which brings a particular
|
|
6
|
+
* peer to the center stage for everyone in the room) and more.
|
|
7
|
+
*
|
|
8
|
+
* To get an instance of `HMSSessionStore` class, You can add an event listener for `ON_SESSION_STORE_AVAILABLE`
|
|
9
|
+
* event on the `HMSSDK` instance
|
|
10
|
+
*
|
|
11
|
+
* For example:
|
|
12
|
+
* ```
|
|
13
|
+
* hmsInstance.addEventListener(HMSUpdateListenerActions.ON_SESSION_STORE_AVAILABLE, <your callback function>);
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Checkout Session Store docs fore more details ${@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/session-store}
|
|
17
|
+
*/
|
|
18
|
+
export declare class HMSSessionStore {
|
|
19
|
+
private _deviceEventEmitterSubscription?;
|
|
20
|
+
private _eventEmitter?;
|
|
21
|
+
private _addedKeyChangeListenerCount;
|
|
22
|
+
/**
|
|
23
|
+
* This method sets a value for a specific key on session store.
|
|
24
|
+
* Once a value is assigned, it will be available for other peers in the room
|
|
25
|
+
* who are listening for changes in value for that specific key.
|
|
26
|
+
*
|
|
27
|
+
* @param {HMSSessionStoreValue} value
|
|
28
|
+
* @param {string} key
|
|
29
|
+
* @returns {Promise}
|
|
30
|
+
*/
|
|
31
|
+
set(value: HMSSessionStoreValue, key: string): Promise<{
|
|
32
|
+
success: true;
|
|
33
|
+
finalValue: HMSSessionStoreValue;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* This method returns the value of any specified key on session store.
|
|
37
|
+
* Note that you will not get updates for any change in value of the specified key,
|
|
38
|
+
* It returns the latest value at the time it was called.
|
|
39
|
+
*
|
|
40
|
+
* To listen to value change updates use `addKeyChangeListener` method instead.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} key
|
|
43
|
+
* @returns {Promise}
|
|
44
|
+
*/
|
|
45
|
+
get(key: string): Promise<HMSSessionStoreValue>;
|
|
46
|
+
/**
|
|
47
|
+
* This method registers a callback function for listening to value changes of a particular key.
|
|
48
|
+
* Registered Callback function will be called initially with latest value and whenever the value updates
|
|
49
|
+
*
|
|
50
|
+
* @param {string[]} forKeys
|
|
51
|
+
* @param {Function} callback
|
|
52
|
+
* @returns {Object} subscription object
|
|
53
|
+
*/
|
|
54
|
+
addKeyChangeListener<T extends string[]>(forKeys: T, callback: (error: string | null, data: {
|
|
55
|
+
key: T[number];
|
|
56
|
+
value: HMSSessionStoreValue;
|
|
57
|
+
} | null) => void): {
|
|
58
|
+
remove: () => void;
|
|
59
|
+
};
|
|
60
|
+
private _cleanup;
|
|
61
|
+
private _deviceEventEmitterListener;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HMSLayer } from './HMSLayer';
|
|
2
|
+
import type { HMSVideoResolution } from './HMSVideoResolution';
|
|
3
|
+
export declare class HMSSimulcastLayerDefinition {
|
|
4
|
+
layer: HMSLayer;
|
|
5
|
+
resolution: HMSVideoResolution;
|
|
6
|
+
constructor(params: {
|
|
7
|
+
layer: HMSLayer;
|
|
8
|
+
resolution: HMSVideoResolution;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class HMSSimulcastLayerSettingsPolicy {
|
|
2
|
+
rid?: string;
|
|
3
|
+
scaleResolutionDownBy?: number;
|
|
4
|
+
maxBitrate?: number;
|
|
5
|
+
maxFramerate?: number;
|
|
6
|
+
constructor(params: {
|
|
7
|
+
rid?: string;
|
|
8
|
+
scaleResolutionDownBy?: number;
|
|
9
|
+
maxBitrate?: number;
|
|
10
|
+
maxFramerate?: number;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import type { HMSSimulcastSettingsPolicy } from './HMSSimulcastSettingsPolicy';
|
|
1
2
|
export declare class HMSSimulcastSettings {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
video?: HMSSimulcastSettingsPolicy;
|
|
4
|
+
screen?: HMSSimulcastSettingsPolicy;
|
|
5
|
+
constructor(params: {
|
|
6
|
+
video?: HMSSimulcastSettingsPolicy;
|
|
7
|
+
screen?: HMSSimulcastSettingsPolicy;
|
|
8
|
+
});
|
|
5
9
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class HMSSubscribeDegradationPolicy {
|
|
2
|
+
packetLossThreshold?: number;
|
|
3
|
+
degradeGracePeriodSeconds?: number;
|
|
4
|
+
recoverGracePeriodSeconds?: number;
|
|
5
|
+
constructor(params: {
|
|
6
|
+
packetLossThreshold?: number;
|
|
7
|
+
degradeGracePeriodSeconds?: number;
|
|
8
|
+
recoverGracePeriodSeconds?: number;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { HMSSubscribeDegradationPolicy } from './HMSSubscribeDegradationPolicy';
|
|
1
2
|
export declare class HMSSubscribeSettings {
|
|
2
|
-
subscribeTo?: [
|
|
3
|
+
subscribeTo?: string[];
|
|
3
4
|
maxSubsBitRate: number;
|
|
5
|
+
subscribeDegradation?: HMSSubscribeDegradationPolicy;
|
|
4
6
|
constructor(params: {
|
|
5
|
-
subscribeTo?: [
|
|
7
|
+
subscribeTo?: string[];
|
|
6
8
|
maxSubsBitRate: number;
|
|
9
|
+
subscribeDegradation?: HMSSubscribeDegradationPolicy;
|
|
7
10
|
});
|
|
8
11
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These are the available events emitted by the `HMSSDK`
|
|
3
|
+
*
|
|
4
|
+
* For more info about these events, checkout Event Listener docs
|
|
5
|
+
* {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/event-listeners}
|
|
6
|
+
*/
|
|
1
7
|
export declare enum HMSUpdateListenerActions {
|
|
2
8
|
ON_PREVIEW = "ON_PREVIEW",
|
|
3
9
|
ON_JOIN = "ON_JOIN",
|
|
@@ -17,5 +23,7 @@ export declare enum HMSUpdateListenerActions {
|
|
|
17
23
|
ON_LOCAL_VIDEO_STATS = "ON_LOCAL_VIDEO_STATS",
|
|
18
24
|
ON_REMOTE_AUDIO_STATS = "ON_REMOTE_AUDIO_STATS",
|
|
19
25
|
ON_REMOTE_VIDEO_STATS = "ON_REMOTE_VIDEO_STATS",
|
|
20
|
-
ON_AUDIO_DEVICE_CHANGED = "ON_AUDIO_DEVICE_CHANGED"
|
|
26
|
+
ON_AUDIO_DEVICE_CHANGED = "ON_AUDIO_DEVICE_CHANGED",
|
|
27
|
+
ON_SESSION_STORE_AVAILABLE = "ON_SESSION_STORE_AVAILABLE",
|
|
28
|
+
ON_SESSION_STORE_CHANGED = "ON_SESSION_STORE_CHANGED"
|
|
21
29
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { HMSSimulcastLayerSettings } from './HMSSimulcastLayerSettings';
|
|
2
2
|
import type { HMSCameraFacing } from './HMSCameraFacing';
|
|
3
3
|
import type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';
|
|
4
|
+
/**
|
|
5
|
+
* Customize local peer's Video track settings before Joining the Room.
|
|
6
|
+
*
|
|
7
|
+
* Checkout Track Settings docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings}
|
|
8
|
+
*/
|
|
4
9
|
export declare class HMSVideoTrackSettings {
|
|
5
10
|
readonly simulcastSettings?: HMSSimulcastLayerSettings[];
|
|
6
11
|
initialState?: HMSTrackSettingsInitState;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
3
|
import { HMSVideoViewMode } from './HMSVideoViewMode';
|
|
4
|
-
interface HmsComponentProps {
|
|
4
|
+
export interface HmsComponentProps {
|
|
5
5
|
trackId: string;
|
|
6
6
|
style?: ViewStyle;
|
|
7
7
|
mirror?: boolean;
|
|
8
|
+
autoSimulcast?: boolean;
|
|
8
9
|
scaleType?: HMSVideoViewMode;
|
|
9
10
|
setZOrderMediaOverlay?: boolean;
|
|
10
11
|
id: string;
|
|
11
12
|
}
|
|
12
13
|
export declare const HmsViewComponent: React.ForwardRefExoticComponent<HmsComponentProps & React.RefAttributes<any>>;
|
|
13
|
-
export {};
|
|
@@ -75,6 +75,13 @@ export * from './classes/HMSLogSettings';
|
|
|
75
75
|
export * from './classes/HMSLogAlarmManager';
|
|
76
76
|
export * from './classes/HMSMessageType';
|
|
77
77
|
export * from './classes/HMSPIPListenerActions';
|
|
78
|
+
export * from './classes/HMSLayer';
|
|
79
|
+
export * from './classes/HMSSimulcastLayerDefinition';
|
|
80
|
+
export * from './classes/HMSQualityLimitationReasons';
|
|
81
|
+
export * from './classes/HMSQualityLimitationReason';
|
|
82
|
+
export * from './classes/HMSCameraControl';
|
|
83
|
+
export * from './classes/HMSIOSAudioMode';
|
|
84
|
+
export type { HMSSessionStore, HMSSessionStoreValue, } from './classes/HMSSessionStore';
|
|
78
85
|
export type { HmsViewComponent as HMSView } from './classes/HmsView';
|
|
79
86
|
import { HMSSDK as HmsManager } from './classes/HMSSDK';
|
|
80
87
|
export default HmsManager;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { EmitterSubscription } from './_EmitterSubscription';
|
|
2
|
+
import { EventSubscriptionVendor } from './_EventSubscriptionVendor';
|
|
3
|
+
export { EmitterSubscription } from './_EmitterSubscription';
|
|
4
|
+
/**
|
|
5
|
+
* @class EventEmitter
|
|
6
|
+
* @description
|
|
7
|
+
* An EventEmitter is responsible for managing a set of listeners and publishing
|
|
8
|
+
* events to them when it is told that such events happened. In addition to the
|
|
9
|
+
* data for the given event it also sends a event control object which allows
|
|
10
|
+
* the listeners/handlers to prevent the default behavior of the given event.
|
|
11
|
+
*
|
|
12
|
+
* The emitter is designed to be generic enough to support all the different
|
|
13
|
+
* contexts in which one might want to emit events. It is a simple multicast
|
|
14
|
+
* mechanism on top of which extra functionality can be composed. For example, a
|
|
15
|
+
* more advanced emitter may use an EventHolder and EventFactory.
|
|
16
|
+
*/
|
|
17
|
+
export declare class EventEmitter {
|
|
18
|
+
_subscriber: EventSubscriptionVendor;
|
|
19
|
+
/**
|
|
20
|
+
* @constructor
|
|
21
|
+
*
|
|
22
|
+
* @param {EventSubscriptionVendor} subscriber - Optional subscriber instance
|
|
23
|
+
* to use. If omitted, a new subscriber will be created for the emitter.
|
|
24
|
+
*/
|
|
25
|
+
constructor(subscriber?: EventSubscriptionVendor | null);
|
|
26
|
+
/**
|
|
27
|
+
* Adds a listener to be invoked when events of the specified type are
|
|
28
|
+
* emitted. An optional calling context may be provided. The data arguments
|
|
29
|
+
* emitted will be passed to the listener function.
|
|
30
|
+
*
|
|
31
|
+
* TODO: Annotate the listener arg's type. This is tricky because listeners
|
|
32
|
+
* can be invoked with varargs.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} eventType - Name of the event to listen to
|
|
35
|
+
* @param {function} listener - Function to invoke when the specified event is
|
|
36
|
+
* emitted
|
|
37
|
+
* @param {*} context - Optional context object to use when invoking the
|
|
38
|
+
* listener
|
|
39
|
+
*/
|
|
40
|
+
addListener(eventType: string, listener: Function, context: Object | null | undefined): EmitterSubscription;
|
|
41
|
+
/**
|
|
42
|
+
* Removes all of the registered listeners, including those registered as
|
|
43
|
+
* listener maps.
|
|
44
|
+
*
|
|
45
|
+
* @param {?string} eventType - Optional name of the event whose registered
|
|
46
|
+
* listeners to remove
|
|
47
|
+
*/
|
|
48
|
+
removeAllListeners(eventType: string | undefined | null): void;
|
|
49
|
+
/**
|
|
50
|
+
* Removes a specific subscription. Called by the `remove()` method of the
|
|
51
|
+
* subscription itself to ensure any necessary cleanup is performed.
|
|
52
|
+
*/
|
|
53
|
+
removeSubscription(subscription: EmitterSubscription): void;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the number of listeners that are currently registered for the given
|
|
56
|
+
* event.
|
|
57
|
+
*
|
|
58
|
+
* @param {string} eventType - Name of the event to query
|
|
59
|
+
* @returns {number}
|
|
60
|
+
*/
|
|
61
|
+
listenerCount(eventType: string): number;
|
|
62
|
+
/**
|
|
63
|
+
* Emits an event of the given type with the given data. All handlers of that
|
|
64
|
+
* particular type will be notified.
|
|
65
|
+
*
|
|
66
|
+
* @param {string} eventType - Name of the event to emit
|
|
67
|
+
* @param {...*} Arbitrary arguments to be passed to each registered listener
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* emitter.addListener('someEvent', function(message) {
|
|
71
|
+
* console.log(message);
|
|
72
|
+
* });
|
|
73
|
+
*
|
|
74
|
+
* emitter.emit('someEvent', 'abc'); // logs 'abc'
|
|
75
|
+
*/
|
|
76
|
+
emit(eventType: string, ...args: any[]): void;
|
|
77
|
+
/**
|
|
78
|
+
* Removes the given listener for event of specific type.
|
|
79
|
+
*
|
|
80
|
+
* @param {string} eventType - Name of the event to emit
|
|
81
|
+
* @param {function} listener - Function to invoke when the specified event is
|
|
82
|
+
* emitted
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* emitter.removeListener('someEvent', function(message) {
|
|
86
|
+
* console.log(message);
|
|
87
|
+
* }); // removes the listener if already registered
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
90
|
+
removeListener(eventType: string, listener: Function): void;
|
|
91
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EventSubscription } from './_EventSubscription';
|
|
2
|
+
import type { EventEmitter } from './EventEmitter';
|
|
3
|
+
import type { EventSubscriptionVendor } from './_EventSubscriptionVendor';
|
|
4
|
+
/**
|
|
5
|
+
* EmitterSubscription represents a subscription with listener and context data.
|
|
6
|
+
*/
|
|
7
|
+
export declare class EmitterSubscription extends EventSubscription {
|
|
8
|
+
emitter: EventEmitter;
|
|
9
|
+
listener: Function;
|
|
10
|
+
context: Object | null | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* @param {EventEmitter} emitter - The event emitter that registered this
|
|
13
|
+
* subscription
|
|
14
|
+
* @param {EventSubscriptionVendor} subscriber - The subscriber that controls
|
|
15
|
+
* this subscription
|
|
16
|
+
* @param {function} listener - Function to invoke when the specified event is
|
|
17
|
+
* emitted
|
|
18
|
+
* @param {*} context - Optional context object to use when invoking the
|
|
19
|
+
* listener
|
|
20
|
+
*/
|
|
21
|
+
constructor(emitter: EventEmitter, subscriber: EventSubscriptionVendor, listener: Function, context: Object | undefined | null);
|
|
22
|
+
/**
|
|
23
|
+
* Removes this subscription from the emitter that registered it.
|
|
24
|
+
* Note: we're overriding the `remove()` method of EventSubscription here
|
|
25
|
+
* but deliberately not calling `super.remove()` as the responsibility
|
|
26
|
+
* for removing the subscription lies with the EventEmitter.
|
|
27
|
+
*/
|
|
28
|
+
remove(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EventSubscriptionVendor } from './_EventSubscriptionVendor';
|
|
2
|
+
/**
|
|
3
|
+
* EventSubscription represents a subscription to a particular event. It can
|
|
4
|
+
* remove its own subscription.
|
|
5
|
+
*/
|
|
6
|
+
export declare class EventSubscription {
|
|
7
|
+
eventType: string;
|
|
8
|
+
key: number;
|
|
9
|
+
subscriber: EventSubscriptionVendor;
|
|
10
|
+
/**
|
|
11
|
+
* @param {EventSubscriptionVendor} subscriber the subscriber that controls
|
|
12
|
+
* this subscription.
|
|
13
|
+
*/
|
|
14
|
+
constructor(subscriber: EventSubscriptionVendor);
|
|
15
|
+
/**
|
|
16
|
+
* Removes this subscription from the subscriber that controls it.
|
|
17
|
+
*/
|
|
18
|
+
remove(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { EventSubscription } from './_EventSubscription';
|
|
2
|
+
/**
|
|
3
|
+
* EventSubscriptionVendor stores a set of EventSubscriptions that are
|
|
4
|
+
* subscribed to a particular event type.
|
|
5
|
+
*/
|
|
6
|
+
export declare class EventSubscriptionVendor {
|
|
7
|
+
_subscriptionsForType: Record<string, EventSubscription[] | null | undefined>;
|
|
8
|
+
_currentSubscription: EventSubscription | null | undefined;
|
|
9
|
+
constructor();
|
|
10
|
+
/**
|
|
11
|
+
* Adds a subscription keyed by an event type.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} eventType
|
|
14
|
+
* @param {EventSubscription} subscription
|
|
15
|
+
*/
|
|
16
|
+
addSubscription(eventType: string, subscription: EventSubscription): EventSubscription;
|
|
17
|
+
/**
|
|
18
|
+
* Removes a bulk set of the subscriptions.
|
|
19
|
+
*
|
|
20
|
+
* @param {?string} eventType - Optional name of the event type whose
|
|
21
|
+
* registered supscriptions to remove, if null or undefined remove all subscriptions.
|
|
22
|
+
*/
|
|
23
|
+
removeAllSubscriptions(eventType: string | undefined | null): void;
|
|
24
|
+
/**
|
|
25
|
+
* Removes a specific subscription. Instead of calling this function, call
|
|
26
|
+
* `subscription.remove()` directly.
|
|
27
|
+
*
|
|
28
|
+
* @param {object} subscription
|
|
29
|
+
*/
|
|
30
|
+
removeSubscription(subscription: EventSubscription): void;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the array of subscriptions that are currently registered for the
|
|
33
|
+
* given event type.
|
|
34
|
+
*
|
|
35
|
+
* Note: This array can be potentially sparse as subscriptions are deleted
|
|
36
|
+
* from it when they are removed.
|
|
37
|
+
*
|
|
38
|
+
* TODO: This returns a nullable array. wat?
|
|
39
|
+
*
|
|
40
|
+
* @param {string} eventType
|
|
41
|
+
* @returns {?array}
|
|
42
|
+
*/
|
|
43
|
+
getSubscriptionsForType(eventType: string): EventSubscription[] | null | undefined;
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './emitter/EventEmitter';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@100mslive/react-native-hms",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Integrate Real Time Audio and Video conferencing, Interactive Live Streaming, and Chat in your apps with 100ms React Native SDK. With support for HLS and RTMP Live Streaming and Recording, Picture-in-Picture (PiP), one-to-one Video Call Modes, Audio Rooms, Video Player and much more, add immersive real-time communications to your apps.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -68,7 +68,26 @@
|
|
|
68
68
|
"ios",
|
|
69
69
|
"android",
|
|
70
70
|
"web",
|
|
71
|
-
"interactive"
|
|
71
|
+
"interactive",
|
|
72
|
+
"hls",
|
|
73
|
+
"rtmp",
|
|
74
|
+
"pip",
|
|
75
|
+
"voip",
|
|
76
|
+
"player",
|
|
77
|
+
"webrtc",
|
|
78
|
+
"stream",
|
|
79
|
+
"communication",
|
|
80
|
+
"conference",
|
|
81
|
+
"whiteboard",
|
|
82
|
+
"session",
|
|
83
|
+
"polls",
|
|
84
|
+
"quiz",
|
|
85
|
+
"call",
|
|
86
|
+
"callkit",
|
|
87
|
+
"connection",
|
|
88
|
+
"service",
|
|
89
|
+
"telecom",
|
|
90
|
+
"reaction"
|
|
72
91
|
],
|
|
73
92
|
"repository": "https://github.com/100mslive/100ms-react-native",
|
|
74
93
|
"author": "Yogesh <yogesh@100ms.live> (https://www.100ms.live/)",
|
package/sdk-versions.json
CHANGED
|
@@ -1,17 +1,33 @@
|
|
|
1
|
+
import type { HMSIOSAudioMode } from './HMSIOSAudioMode';
|
|
1
2
|
import type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';
|
|
2
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Customize local peer's Audio track settings before Joining the Room.
|
|
6
|
+
*
|
|
7
|
+
* Checkout Track Settings docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings}
|
|
8
|
+
*/
|
|
3
9
|
export class HMSAudioTrackSettings {
|
|
4
10
|
initialState?: HMSTrackSettingsInitState;
|
|
5
11
|
useHardwareEchoCancellation?: boolean; // android only
|
|
6
12
|
audioSource?: string[]; // ios only
|
|
7
13
|
|
|
14
|
+
/**
|
|
15
|
+
* [iOS only] `audioMode` allows you to capture audio in its highest quality
|
|
16
|
+
* by disabling voice processing and increasing the maximum bandwidth limit
|
|
17
|
+
*
|
|
18
|
+
* Checkout Music Mode docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/microphone/music-mode}
|
|
19
|
+
*/
|
|
20
|
+
audioMode?: HMSIOSAudioMode; // ios only
|
|
21
|
+
|
|
8
22
|
constructor(params: {
|
|
9
23
|
initialState?: HMSTrackSettingsInitState;
|
|
10
24
|
useHardwareEchoCancellation?: boolean;
|
|
11
25
|
audioSource?: string[];
|
|
26
|
+
audioMode?: HMSIOSAudioMode;
|
|
12
27
|
}) {
|
|
13
28
|
this.useHardwareEchoCancellation = params.useHardwareEchoCancellation;
|
|
14
29
|
this.initialState = params.initialState;
|
|
15
30
|
this.audioSource = params.audioSource;
|
|
31
|
+
this.audioMode = params.audioMode;
|
|
16
32
|
}
|
|
17
33
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
2
|
+
import { HMSConstants } from './HMSConstants';
|
|
3
|
+
|
|
4
|
+
const { HMSManager } = NativeModules;
|
|
5
|
+
|
|
6
|
+
export class HMSCameraControl {
|
|
7
|
+
/**
|
|
8
|
+
* It captures the image from the device camera at max possible resolution.
|
|
9
|
+
*
|
|
10
|
+
* @param {boolean} [flash=false] flash - value indicating whether to use flash while capturing image or not
|
|
11
|
+
* @returns Promise - which is resolved with the file path of the captured image saved on the disk
|
|
12
|
+
*/
|
|
13
|
+
static captureImageAtMaxSupportedResolution(
|
|
14
|
+
flash: boolean = false
|
|
15
|
+
): Promise<string> {
|
|
16
|
+
return HMSManager.captureImageAtMaxSupportedResolution({
|
|
17
|
+
id: HMSConstants.DEFAULT_SDK_ID,
|
|
18
|
+
flash,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|