@100mslive/react-native-hms 1.3.0 → 1.5.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/README.md +59 -5
- 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 +49 -14
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +240 -46
- package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManager.kt +5 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSView.kt +29 -21
- package/android/src/main/res/layout/hms_view.xml +2 -2
- package/ios/HMSConstants.swift +31 -0
- package/ios/HMSDecoder.swift +371 -156
- package/ios/HMSManager.m +10 -2
- package/ios/HMSManager.swift +149 -74
- package/ios/HMSRNSDK.swift +431 -181
- package/ios/HMSView.m +1 -0
- package/ios/HMSView.swift +21 -19
- package/lib/commonjs/classes/HMSAudioTrackSettings.js +1 -1
- 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 +95 -13
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSException.js +3 -4
- package/lib/commonjs/classes/HMSException.js.map +1 -1
- 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/HMSLocalVideoTrack.js +5 -6
- package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSMessage.js +1 -2
- package/lib/commonjs/classes/HMSMessage.js.map +1 -1
- package/lib/commonjs/classes/HMSPeer.js +3 -4
- 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 -4
- 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 +70 -62
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- 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/HMSVideoResolution.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrackSettings.js +1 -1
- 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 +60 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/classes/HMSAudioTrackSettings.js +1 -1
- 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 +95 -13
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSException.js +3 -4
- package/lib/module/classes/HMSException.js.map +1 -1
- 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/HMSLocalVideoTrack.js +5 -6
- package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSMessage.js +1 -2
- package/lib/module/classes/HMSMessage.js.map +1 -1
- package/lib/module/classes/HMSPeer.js +3 -4
- 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 -4
- 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 +71 -62
- package/lib/module/classes/HMSSDK.js.map +1 -1
- 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/HMSVideoResolution.js.map +1 -1
- package/lib/module/classes/HMSVideoTrackSettings.js +1 -1
- 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 +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/classes/HMSCameraControl.d.ts +9 -0
- package/lib/typescript/classes/HMSEncoder.d.ts +13 -1
- 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 +24 -42
- 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/HMSVideoResolution.d.ts +2 -2
- package/lib/typescript/classes/HmsView.d.ts +2 -2
- package/lib/typescript/index.d.ts +5 -0
- package/package.json +2 -2
- package/sdk-versions.json +3 -3
- package/src/classes/HMSCameraControl.ts +21 -0
- package/src/classes/HMSEncoder.ts +125 -11
- 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 +99 -67
- 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/HMSVideoResolution.ts +1 -1
- package/src/classes/HmsView.tsx +5 -1
- package/src/index.ts +5 -0
package/src/classes/HMSSDK.tsx
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AppState, NativeModules, Platform
|
|
2
|
+
import { AppState, NativeModules, Platform } from 'react-native';
|
|
3
3
|
import { HMSEncoder } from './HMSEncoder';
|
|
4
4
|
import { HMSHelper } from './HMSHelper';
|
|
5
|
-
import { HMSLocalAudioStats } from './HMSLocalAudioStats';
|
|
6
|
-
import { HMSLocalVideoStats } from './HMSLocalVideoStats';
|
|
7
5
|
import { getLogger, logger, setLogger } from './HMSLogger';
|
|
8
|
-
import { HMSRemoteAudioStats } from './HMSRemoteAudioStats';
|
|
9
|
-
import { HMSRemoteVideoStats } from './HMSRemoteVideoStats';
|
|
10
6
|
import { HMSTrackType } from './HMSTrackType';
|
|
11
7
|
import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
|
|
12
|
-
import { HmsViewComponent } from './HmsView';
|
|
8
|
+
import { HmsViewComponent, HmsComponentProps } from './HmsView';
|
|
13
9
|
|
|
14
10
|
import type { HMSConfig } from './HMSConfig';
|
|
15
11
|
import type { HMSLocalPeer } from './HMSLocalPeer';
|
|
@@ -47,14 +43,9 @@ import {
|
|
|
47
43
|
} from './HMSRoomCache';
|
|
48
44
|
import { HMSPeerUpdateOrdinals } from './HMSPeerUpdate';
|
|
49
45
|
|
|
50
|
-
|
|
51
|
-
trackId: string;
|
|
52
|
-
style?: ViewStyle;
|
|
53
|
-
mirror?: boolean;
|
|
54
|
-
scaleType?: HMSVideoViewMode;
|
|
55
|
-
setZOrderMediaOverlay?: boolean;
|
|
56
|
-
}
|
|
46
|
+
type HmsViewProps = Omit<HmsComponentProps, 'id'>;
|
|
57
47
|
|
|
48
|
+
// TODO: Rename to HMSPIPConfig & to be moved to a separate file
|
|
58
49
|
interface PIPConfig {
|
|
59
50
|
aspectRatio?: [number, number];
|
|
60
51
|
endButton?: boolean;
|
|
@@ -79,7 +70,6 @@ export class HMSSDK {
|
|
|
79
70
|
id: string;
|
|
80
71
|
private muteStatus: boolean | undefined;
|
|
81
72
|
private appStateSubscription?: any;
|
|
82
|
-
|
|
83
73
|
private onPreviewDelegate?: any;
|
|
84
74
|
private onJoinDelegate?: any;
|
|
85
75
|
private onRoomDelegate?: any;
|
|
@@ -151,24 +141,6 @@ export class HMSSDK {
|
|
|
151
141
|
return HmsSdk;
|
|
152
142
|
}
|
|
153
143
|
|
|
154
|
-
/**
|
|
155
|
-
* - Returns the instance of logger which can be used to manipulate log levels.
|
|
156
|
-
* @returns @instance HMSLogger
|
|
157
|
-
* @memberof HMSSDK
|
|
158
|
-
*/
|
|
159
|
-
static getLogger() {
|
|
160
|
-
return getLogger();
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* - Updates the logger for this instance of HMSSDK
|
|
165
|
-
* @param {HMSLogger} hmsLogger
|
|
166
|
-
* @memberof HMSSDK
|
|
167
|
-
*/
|
|
168
|
-
setLogger = (hmsLogger?: HMSLogger) => {
|
|
169
|
-
setLogger(this.id, hmsLogger);
|
|
170
|
-
};
|
|
171
|
-
|
|
172
144
|
/**
|
|
173
145
|
* - Calls removeListeners that in turn breaks all connections with native listeners.
|
|
174
146
|
*
|
|
@@ -182,6 +154,33 @@ export class HMSSDK {
|
|
|
182
154
|
return await HMSManager.destroy({ id: this.id });
|
|
183
155
|
};
|
|
184
156
|
|
|
157
|
+
/**
|
|
158
|
+
* - getAuthTokenByRoomCode function is used to get the Auth Token by Room Code
|
|
159
|
+
*
|
|
160
|
+
* checkout {@link https://www.100ms.live/docs/concepts/v2/concepts/rooms/room-codes/room-codes} for more info
|
|
161
|
+
*
|
|
162
|
+
* @memberof HMSSDK
|
|
163
|
+
*/
|
|
164
|
+
getAuthTokenByRoomCode = async (
|
|
165
|
+
roomCode: string,
|
|
166
|
+
userId?: string,
|
|
167
|
+
endpoint?: string
|
|
168
|
+
): Promise<string> => {
|
|
169
|
+
logger?.verbose('#Function getAuthTokenByRoomCode', {
|
|
170
|
+
id: this.id,
|
|
171
|
+
roomCode,
|
|
172
|
+
userId,
|
|
173
|
+
endpoint,
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
return HMSManager.getAuthTokenByRoomCode({
|
|
177
|
+
id: this.id,
|
|
178
|
+
roomCode,
|
|
179
|
+
userId,
|
|
180
|
+
endpoint,
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
|
|
185
184
|
/**
|
|
186
185
|
* takes an instance of [HMSConfig]{@link HMSConfig} and joins the room.
|
|
187
186
|
* after joining the room user will start receiving the events and updates of the room.
|
|
@@ -242,6 +241,7 @@ export class HMSSDK {
|
|
|
242
241
|
* - The appearance of tile is completely customizable with style prop.
|
|
243
242
|
* - Scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
|
|
244
243
|
* - Mirror to flip the video vertically.
|
|
244
|
+
* - Auto Simulcast to automatically select the best Streaming Quality of track if feature is enabled in Room.
|
|
245
245
|
*
|
|
246
246
|
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/render-video} for more info
|
|
247
247
|
*
|
|
@@ -249,12 +249,20 @@ export class HMSSDK {
|
|
|
249
249
|
* @memberof HMSSDK
|
|
250
250
|
*/
|
|
251
251
|
HmsView = React.forwardRef<any, HmsViewProps>((props, ref) => {
|
|
252
|
-
const {
|
|
252
|
+
const {
|
|
253
|
+
trackId,
|
|
254
|
+
style,
|
|
255
|
+
mirror,
|
|
256
|
+
scaleType,
|
|
257
|
+
setZOrderMediaOverlay,
|
|
258
|
+
autoSimulcast,
|
|
259
|
+
} = props;
|
|
253
260
|
return (
|
|
254
261
|
<HmsViewComponent
|
|
255
262
|
ref={ref}
|
|
256
263
|
trackId={trackId}
|
|
257
264
|
style={style}
|
|
265
|
+
autoSimulcast={autoSimulcast}
|
|
258
266
|
setZOrderMediaOverlay={setZOrderMediaOverlay}
|
|
259
267
|
mirror={mirror}
|
|
260
268
|
scaleType={scaleType}
|
|
@@ -837,36 +845,6 @@ export class HMSSDK {
|
|
|
837
845
|
return await HMSManager.stopScreenshare({ id: this.id });
|
|
838
846
|
};
|
|
839
847
|
|
|
840
|
-
/**
|
|
841
|
-
* - enableRTCStats sets a boolean in native side which in turn allows several events to be passed
|
|
842
|
-
* through the bridge these events are {@link RTCStatsListener}, {@link onRemoteVideoStatsListener},
|
|
843
|
-
* {@link onRemoteAudioStatsListener}, {@link onLocalAudioStatsListener} and {@link onLocalVideoStatsListener}
|
|
844
|
-
*
|
|
845
|
-
* - These listeners get various dataPoints for current peers and their connectivity to the room
|
|
846
|
-
* such as jitter, latency etc.
|
|
847
|
-
*
|
|
848
|
-
* - currently available for iOS only
|
|
849
|
-
*
|
|
850
|
-
* @memberof HMSSDK
|
|
851
|
-
*/
|
|
852
|
-
enableRTCStats = () => {
|
|
853
|
-
logger?.verbose('#Function enableRTCStats', { id: this.id });
|
|
854
|
-
HMSManager.enableRTCStats({ id: this.id });
|
|
855
|
-
};
|
|
856
|
-
|
|
857
|
-
/**
|
|
858
|
-
* - disable RTCStats sets the same boolean to false that was set true by enableRTCStats.
|
|
859
|
-
* that activates a check which filters out the events acquired in native listeners and don't
|
|
860
|
-
* let them pass through bridge
|
|
861
|
-
*
|
|
862
|
-
* - currently available for iOS only.
|
|
863
|
-
* @memberof HMSSDK
|
|
864
|
-
*/
|
|
865
|
-
disableRTCStats = () => {
|
|
866
|
-
logger?.verbose('#Function disableRTCStats', { id: this.id });
|
|
867
|
-
HMSManager.disableRTCStats({ id: this.id });
|
|
868
|
-
};
|
|
869
|
-
|
|
870
848
|
enableNetworkQualityUpdates = () => {
|
|
871
849
|
logger?.verbose('#Function enableNetworkQualityUpdates', { id: this.id });
|
|
872
850
|
HMSManager.enableNetworkQualityUpdates({ id: this.id });
|
|
@@ -1098,6 +1076,34 @@ export class HMSSDK {
|
|
|
1098
1076
|
return await HMSManager.getSessionMetaData({ id: this.id });
|
|
1099
1077
|
};
|
|
1100
1078
|
|
|
1079
|
+
getRemoteVideoTrackFromTrackId = async (trackId: string) => {
|
|
1080
|
+
logger?.verbose('#Function getRemoteVideoTrackFromTrackId', {
|
|
1081
|
+
id: this.id,
|
|
1082
|
+
trackId,
|
|
1083
|
+
});
|
|
1084
|
+
|
|
1085
|
+
const remoteVideoTrackData =
|
|
1086
|
+
await HMSManager.getRemoteVideoTrackFromTrackId({
|
|
1087
|
+
id: this.id,
|
|
1088
|
+
trackId,
|
|
1089
|
+
});
|
|
1090
|
+
return HMSEncoder.encodeHmsRemoteVideoTrack(remoteVideoTrackData, this.id);
|
|
1091
|
+
};
|
|
1092
|
+
|
|
1093
|
+
getRemoteAudioTrackFromTrackId = async (trackId: string) => {
|
|
1094
|
+
logger?.verbose('#Function getRemoteAudioTrackFromTrackId', {
|
|
1095
|
+
id: this.id,
|
|
1096
|
+
trackId,
|
|
1097
|
+
});
|
|
1098
|
+
|
|
1099
|
+
const remoteAudioTrackData =
|
|
1100
|
+
await HMSManager.getRemoteAudioTrackFromTrackId({
|
|
1101
|
+
id: this.id,
|
|
1102
|
+
trackId,
|
|
1103
|
+
});
|
|
1104
|
+
return HMSEncoder.encodeHmsRemoteAudioTrack(remoteAudioTrackData, this.id);
|
|
1105
|
+
};
|
|
1106
|
+
|
|
1101
1107
|
/**
|
|
1102
1108
|
* - This is a prototype event listener that takes action and listens for updates related to that particular action
|
|
1103
1109
|
*
|
|
@@ -2097,7 +2103,9 @@ export class HMSSDK {
|
|
|
2097
2103
|
return;
|
|
2098
2104
|
}
|
|
2099
2105
|
|
|
2100
|
-
let localAudioStats =
|
|
2106
|
+
let localAudioStats = HMSEncoder.encodeHMSLocalAudioStats(
|
|
2107
|
+
data.localAudioStats
|
|
2108
|
+
);
|
|
2101
2109
|
let peer = HMSEncoder.encodeHmsPeer(data.peer);
|
|
2102
2110
|
let track = HMSEncoder.encodeHmsLocalAudioTrack(data.track, this.id);
|
|
2103
2111
|
|
|
@@ -2117,7 +2125,9 @@ export class HMSSDK {
|
|
|
2117
2125
|
return;
|
|
2118
2126
|
}
|
|
2119
2127
|
|
|
2120
|
-
let localVideoStats =
|
|
2128
|
+
let localVideoStats = HMSEncoder.encodeHMSLocalVideoStats(
|
|
2129
|
+
data.localVideoStats
|
|
2130
|
+
);
|
|
2121
2131
|
let peer = HMSEncoder.encodeHmsPeer(data.peer);
|
|
2122
2132
|
let track = HMSEncoder.encodeHmsLocalVideoTrack(data.track, this.id);
|
|
2123
2133
|
|
|
@@ -2137,7 +2147,9 @@ export class HMSSDK {
|
|
|
2137
2147
|
return;
|
|
2138
2148
|
}
|
|
2139
2149
|
|
|
2140
|
-
let remoteAudioStats =
|
|
2150
|
+
let remoteAudioStats = HMSEncoder.encodeHMSRemoteAudioStats(
|
|
2151
|
+
data.remoteAudioStats
|
|
2152
|
+
);
|
|
2141
2153
|
let peer = HMSEncoder.encodeHmsPeer(data.peer);
|
|
2142
2154
|
let track = HMSEncoder.encodeHmsRemoteAudioTrack(data.track, this.id);
|
|
2143
2155
|
|
|
@@ -2162,7 +2174,9 @@ export class HMSSDK {
|
|
|
2162
2174
|
return;
|
|
2163
2175
|
}
|
|
2164
2176
|
|
|
2165
|
-
let remoteVideoStats =
|
|
2177
|
+
let remoteVideoStats = HMSEncoder.encodeHMSRemoteVideoStats(
|
|
2178
|
+
data.remoteVideoStats
|
|
2179
|
+
);
|
|
2166
2180
|
let peer = HMSEncoder.encodeHmsPeer(data.peer);
|
|
2167
2181
|
let track = HMSEncoder.encodeHmsRemoteVideoTrack(data.track, this.id);
|
|
2168
2182
|
|
|
@@ -2230,4 +2244,22 @@ export class HMSSDK {
|
|
|
2230
2244
|
id: this.id,
|
|
2231
2245
|
});
|
|
2232
2246
|
}
|
|
2247
|
+
|
|
2248
|
+
/**
|
|
2249
|
+
* - Returns the instance of logger which can be used to manipulate log levels.
|
|
2250
|
+
* @returns @instance HMSLogger
|
|
2251
|
+
* @memberof HMSSDK
|
|
2252
|
+
*/
|
|
2253
|
+
static getLogger() {
|
|
2254
|
+
return getLogger();
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
/**
|
|
2258
|
+
* - Updates the logger for this instance of HMSSDK
|
|
2259
|
+
* @param {HMSLogger} hmsLogger
|
|
2260
|
+
* @memberof HMSSDK
|
|
2261
|
+
*/
|
|
2262
|
+
setLogger = (hmsLogger?: HMSLogger) => {
|
|
2263
|
+
setLogger(this.id, hmsLogger);
|
|
2264
|
+
};
|
|
2233
2265
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HMSLayer } from './HMSLayer';
|
|
2
|
+
import type { HMSVideoResolution } from './HMSVideoResolution';
|
|
3
|
+
|
|
4
|
+
export class HMSSimulcastLayerDefinition {
|
|
5
|
+
layer: HMSLayer;
|
|
6
|
+
resolution: HMSVideoResolution;
|
|
7
|
+
|
|
8
|
+
constructor(params: { layer: HMSLayer; resolution: HMSVideoResolution }) {
|
|
9
|
+
this.layer = params.layer;
|
|
10
|
+
this.resolution = params.resolution;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class HMSSimulcastLayerSettingsPolicy {
|
|
2
|
+
rid?: string;
|
|
3
|
+
scaleResolutionDownBy?: number;
|
|
4
|
+
maxBitrate?: number;
|
|
5
|
+
maxFramerate?: number;
|
|
6
|
+
|
|
7
|
+
constructor(params: {
|
|
8
|
+
rid?: string;
|
|
9
|
+
scaleResolutionDownBy?: number;
|
|
10
|
+
maxBitrate?: number;
|
|
11
|
+
maxFramerate?: number;
|
|
12
|
+
}) {
|
|
13
|
+
this.rid = params.rid;
|
|
14
|
+
this.scaleResolutionDownBy = params.scaleResolutionDownBy;
|
|
15
|
+
this.maxBitrate = params.maxBitrate;
|
|
16
|
+
this.maxFramerate = params.maxFramerate;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import type { HMSSimulcastSettingsPolicy } from './HMSSimulcastSettingsPolicy';
|
|
2
|
+
|
|
1
3
|
export class HMSSimulcastSettings {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
video?: HMSSimulcastSettingsPolicy;
|
|
5
|
+
screen?: HMSSimulcastSettingsPolicy;
|
|
6
|
+
|
|
7
|
+
constructor(params: {
|
|
8
|
+
video?: HMSSimulcastSettingsPolicy;
|
|
9
|
+
screen?: HMSSimulcastSettingsPolicy;
|
|
10
|
+
}) {
|
|
11
|
+
this.video = params.video;
|
|
12
|
+
this.screen = params.screen;
|
|
13
|
+
}
|
|
5
14
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HMSSimulcastLayerSettingsPolicy } from './HMSSimulcastLayerSettingsPolicy';
|
|
2
|
+
|
|
3
|
+
export class HMSSimulcastSettingsPolicy {
|
|
4
|
+
layers?: HMSSimulcastLayerSettingsPolicy[];
|
|
5
|
+
|
|
6
|
+
constructor(params: { layers?: HMSSimulcastLayerSettingsPolicy[] }) {
|
|
7
|
+
this.layers = params.layers;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class HMSSubscribeDegradationPolicy {
|
|
2
|
+
packetLossThreshold?: number;
|
|
3
|
+
degradeGracePeriodSeconds?: number;
|
|
4
|
+
recoverGracePeriodSeconds?: number;
|
|
5
|
+
|
|
6
|
+
constructor(params: {
|
|
7
|
+
packetLossThreshold?: number;
|
|
8
|
+
degradeGracePeriodSeconds?: number;
|
|
9
|
+
recoverGracePeriodSeconds?: number;
|
|
10
|
+
}) {
|
|
11
|
+
this.packetLossThreshold = params.packetLossThreshold;
|
|
12
|
+
this.degradeGracePeriodSeconds = params.degradeGracePeriodSeconds;
|
|
13
|
+
this.recoverGracePeriodSeconds = params.recoverGracePeriodSeconds;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import type { HMSSubscribeDegradationPolicy } from './HMSSubscribeDegradationPolicy';
|
|
2
|
+
|
|
1
3
|
export class HMSSubscribeSettings {
|
|
2
|
-
subscribeTo?: [
|
|
4
|
+
subscribeTo?: string[];
|
|
3
5
|
maxSubsBitRate: number;
|
|
6
|
+
subscribeDegradation?: HMSSubscribeDegradationPolicy;
|
|
4
7
|
|
|
5
|
-
constructor(params: {
|
|
8
|
+
constructor(params: {
|
|
9
|
+
subscribeTo?: string[];
|
|
10
|
+
maxSubsBitRate: number;
|
|
11
|
+
subscribeDegradation?: HMSSubscribeDegradationPolicy;
|
|
12
|
+
}) {
|
|
6
13
|
this.subscribeTo = params.subscribeTo;
|
|
7
14
|
this.maxSubsBitRate = params.maxSubsBitRate;
|
|
15
|
+
this.subscribeDegradation = params.subscribeDegradation;
|
|
8
16
|
}
|
|
9
17
|
}
|
package/src/classes/HmsView.tsx
CHANGED
|
@@ -15,6 +15,7 @@ interface HmsViewProps {
|
|
|
15
15
|
id: string;
|
|
16
16
|
mirror: boolean;
|
|
17
17
|
};
|
|
18
|
+
autoSimulcast: boolean;
|
|
18
19
|
setZOrderMediaOverlay: boolean;
|
|
19
20
|
scaleType: HMSVideoViewMode;
|
|
20
21
|
style: ViewStyle;
|
|
@@ -26,10 +27,11 @@ const HmsView = requireNativeComponent<HmsViewProps>('HMSView');
|
|
|
26
27
|
let _nextRequestId = 1;
|
|
27
28
|
let _requestMap = new Map();
|
|
28
29
|
|
|
29
|
-
interface HmsComponentProps {
|
|
30
|
+
export interface HmsComponentProps {
|
|
30
31
|
trackId: string;
|
|
31
32
|
style?: ViewStyle;
|
|
32
33
|
mirror?: boolean;
|
|
34
|
+
autoSimulcast?: boolean;
|
|
33
35
|
scaleType?: HMSVideoViewMode;
|
|
34
36
|
setZOrderMediaOverlay?: boolean;
|
|
35
37
|
id: string;
|
|
@@ -43,6 +45,7 @@ export const HmsViewComponent = React.forwardRef<any, HmsComponentProps>(
|
|
|
43
45
|
id = HMSConstants.DEFAULT_SDK_ID,
|
|
44
46
|
mirror = false,
|
|
45
47
|
setZOrderMediaOverlay = false,
|
|
48
|
+
autoSimulcast = true,
|
|
46
49
|
scaleType = HMSVideoViewMode.ASPECT_FILL,
|
|
47
50
|
} = props;
|
|
48
51
|
|
|
@@ -127,6 +130,7 @@ export const HmsViewComponent = React.forwardRef<any, HmsComponentProps>(
|
|
|
127
130
|
onChange={onChange}
|
|
128
131
|
data={data}
|
|
129
132
|
style={tempVal === 0 ? style : temporaryStyles.customStyle}
|
|
133
|
+
autoSimulcast={autoSimulcast}
|
|
130
134
|
scaleType={scaleType}
|
|
131
135
|
setZOrderMediaOverlay={setZOrderMediaOverlay}
|
|
132
136
|
onDataReturned={_onDataReturned}
|
package/src/index.ts
CHANGED
|
@@ -75,6 +75,11 @@ 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';
|
|
78
83
|
export type { HmsViewComponent as HMSView } from './classes/HmsView';
|
|
79
84
|
|
|
80
85
|
import { HMSSDK as HmsManager } from './classes/HMSSDK';
|