@100mslive/react-native-hms 0.8.4 → 0.9.2
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 +247 -26
- package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.idea/gradle.xml +13 -0
- package/android/.idea/misc.xml +9 -0
- package/android/.idea/modules/android.iml +18 -0
- package/android/.idea/modules.xml +8 -0
- package/android/.idea/sonarlint/issuestore/f/0/f07866736216be0ee2aba49e392191aeae700a35 +0 -0
- package/android/.idea/sonarlint/issuestore/index.pb +3 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build.gradle +4 -2
- package/android/local.properties +8 -0
- package/android/src/main/java/com/reactnativehmssdk/HmsDecoder.kt +67 -5
- package/android/src/main/java/com/reactnativehmssdk/HmsHelper.kt +67 -64
- package/android/src/main/java/com/reactnativehmssdk/HmsModule.kt +97 -6
- package/android/src/main/java/com/reactnativehmssdk/HmsSDK.kt +302 -118
- package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +77 -0
- package/android/src/main/java/com/reactnativehmssdk/HmsView.kt +28 -3
- package/android/src/main/java/com/reactnativehmssdk/HmssdkViewManager.kt +10 -1
- package/android/src/main/res/layout/hms_view.xml +19 -0
- package/ios/HmsDecoder.swift +250 -123
- package/ios/HmsHelper.swift +70 -38
- package/ios/HmsManager.m +11 -3
- package/ios/HmsManager.swift +123 -66
- package/ios/HmsSDK.swift +384 -195
- package/ios/HmsView.swift +50 -68
- package/ios/VideoCollectionViewCell.swift +4 -4
- package/lib/commonjs/classes/HMSBrowserRecordingState.js +6 -0
- package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSEncoder.js +180 -3
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSConfig.js +23 -0
- package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -0
- package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js +23 -0
- package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js.map +1 -0
- package/lib/commonjs/classes/HMSHLSRecordingConfig.js +23 -0
- package/lib/commonjs/classes/HMSHLSRecordingConfig.js.map +1 -0
- package/lib/commonjs/classes/HMSHLSRecordingState.js +29 -0
- package/lib/commonjs/classes/HMSHLSRecordingState.js.map +1 -0
- package/lib/commonjs/classes/HMSHLSStreamingState.js +23 -0
- package/lib/commonjs/classes/HMSHLSStreamingState.js.map +1 -0
- package/lib/commonjs/classes/HMSHLSVariant.js +29 -0
- package/lib/commonjs/classes/HMSHLSVariant.js.map +1 -0
- package/lib/commonjs/classes/HMSLocalAudioStats.js +26 -0
- package/lib/commonjs/classes/HMSLocalAudioStats.js.map +1 -0
- package/lib/commonjs/classes/HMSLocalVideoStats.js +32 -0
- package/lib/commonjs/classes/HMSLocalVideoStats.js.map +1 -0
- package/lib/commonjs/classes/HMSLogger.js +48 -21
- package/lib/commonjs/classes/HMSLogger.js.map +1 -1
- package/lib/commonjs/classes/HMSMessage.js +4 -1
- package/lib/commonjs/classes/HMSMessage.js.map +1 -1
- package/lib/commonjs/classes/HMSMessageRecipient.js +26 -0
- package/lib/commonjs/classes/HMSMessageRecipient.js.map +1 -0
- package/lib/commonjs/classes/HMSMessageRecipientType.js +15 -0
- package/lib/commonjs/classes/HMSMessageRecipientType.js.map +1 -0
- package/lib/commonjs/classes/HMSPeerUpdate.js +1 -7
- package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSPermissions.js +2 -2
- package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
- package/lib/commonjs/classes/HMSRTCStats.js +38 -0
- package/lib/commonjs/classes/HMSRTCStats.js.map +1 -0
- package/lib/commonjs/classes/HMSRTCStatsReport.js +26 -0
- package/lib/commonjs/classes/HMSRTCStatsReport.js.map +1 -0
- package/lib/commonjs/classes/HMSRemoteAudioStats.js +32 -0
- package/lib/commonjs/classes/HMSRemoteAudioStats.js.map +1 -0
- package/lib/commonjs/classes/HMSRemoteVideoStats.js +38 -0
- package/lib/commonjs/classes/HMSRemoteVideoStats.js.map +1 -0
- package/lib/commonjs/classes/HMSRoom.js +9 -0
- package/lib/commonjs/classes/HMSRoom.js.map +1 -1
- package/lib/commonjs/classes/HMSRoomUpdate.js +7 -0
- package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSRtmpStreamingState.js +6 -0
- package/lib/commonjs/classes/HMSRtmpStreamingState.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +488 -114
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSServerRecordingState.js +3 -0
- package/lib/commonjs/classes/HMSServerRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSUpdateListenerActions.js +5 -0
- package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +26 -4
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/index.js +196 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/classes/HMSBrowserRecordingState.js +6 -0
- package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -1
- package/lib/module/classes/HMSEncoder.js +172 -3
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSHLSConfig.js +14 -0
- package/lib/module/classes/HMSHLSConfig.js.map +1 -0
- package/lib/module/classes/HMSHLSMeetingURLVariant.js +14 -0
- package/lib/module/classes/HMSHLSMeetingURLVariant.js.map +1 -0
- package/lib/module/classes/HMSHLSRecordingConfig.js +14 -0
- package/lib/module/classes/HMSHLSRecordingConfig.js.map +1 -0
- package/lib/module/classes/HMSHLSRecordingState.js +20 -0
- package/lib/module/classes/HMSHLSRecordingState.js.map +1 -0
- package/lib/module/classes/HMSHLSStreamingState.js +14 -0
- package/lib/module/classes/HMSHLSStreamingState.js.map +1 -0
- package/lib/module/classes/HMSHLSVariant.js +20 -0
- package/lib/module/classes/HMSHLSVariant.js.map +1 -0
- package/lib/module/classes/HMSLocalAudioStats.js +17 -0
- package/lib/module/classes/HMSLocalAudioStats.js.map +1 -0
- package/lib/module/classes/HMSLocalVideoStats.js +23 -0
- package/lib/module/classes/HMSLocalVideoStats.js.map +1 -0
- package/lib/module/classes/HMSLogger.js +48 -21
- package/lib/module/classes/HMSLogger.js.map +1 -1
- package/lib/module/classes/HMSMessage.js +4 -1
- package/lib/module/classes/HMSMessage.js.map +1 -1
- package/lib/module/classes/HMSMessageRecipient.js +17 -0
- package/lib/module/classes/HMSMessageRecipient.js.map +1 -0
- package/lib/module/classes/HMSMessageRecipientType.js +8 -0
- package/lib/module/classes/HMSMessageRecipientType.js.map +1 -0
- package/lib/module/classes/HMSPeerUpdate.js +1 -7
- package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/module/classes/HMSPermissions.js +2 -2
- package/lib/module/classes/HMSPermissions.js.map +1 -1
- package/lib/module/classes/HMSRTCStats.js +29 -0
- package/lib/module/classes/HMSRTCStats.js.map +1 -0
- package/lib/module/classes/HMSRTCStatsReport.js +17 -0
- package/lib/module/classes/HMSRTCStatsReport.js.map +1 -0
- package/lib/module/classes/HMSRemoteAudioStats.js +23 -0
- package/lib/module/classes/HMSRemoteAudioStats.js.map +1 -0
- package/lib/module/classes/HMSRemoteVideoStats.js +29 -0
- package/lib/module/classes/HMSRemoteVideoStats.js.map +1 -0
- package/lib/module/classes/HMSRoom.js +9 -0
- package/lib/module/classes/HMSRoom.js.map +1 -1
- package/lib/module/classes/HMSRoomUpdate.js +7 -0
- package/lib/module/classes/HMSRoomUpdate.js.map +1 -1
- package/lib/module/classes/HMSRtmpStreamingState.js +6 -0
- package/lib/module/classes/HMSRtmpStreamingState.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +476 -115
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSServerRecordingState.js +3 -0
- package/lib/module/classes/HMSServerRecordingState.js.map +1 -1
- package/lib/module/classes/HMSUpdateListenerActions.js +5 -0
- package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/module/classes/HmsView.js +23 -4
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/module/index.js +14 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/classes/HMSBrowserRecordingState.d.ts +4 -0
- package/lib/typescript/classes/HMSEncoder.d.ts +23 -0
- package/lib/typescript/classes/HMSHLSConfig.d.ts +10 -0
- package/lib/typescript/classes/HMSHLSMeetingURLVariant.d.ts +8 -0
- package/lib/typescript/classes/HMSHLSRecordingConfig.d.ts +8 -0
- package/lib/typescript/classes/HMSHLSRecordingState.d.ts +12 -0
- package/lib/typescript/classes/HMSHLSStreamingState.d.ts +9 -0
- package/lib/typescript/classes/HMSHLSVariant.d.ts +12 -0
- package/lib/typescript/classes/HMSLocalAudioStats.d.ts +10 -0
- package/lib/typescript/classes/HMSLocalVideoStats.d.ts +15 -0
- package/lib/typescript/classes/HMSLogger.d.ts +2 -0
- package/lib/typescript/classes/HMSMessage.d.ts +8 -4
- package/lib/typescript/classes/HMSMessageRecipient.d.ts +13 -0
- package/lib/typescript/classes/HMSMessageRecipientType.d.ts +5 -0
- package/lib/typescript/classes/HMSPeerUpdate.d.ts +2 -8
- package/lib/typescript/classes/HMSPermissions.d.ts +2 -2
- package/lib/typescript/classes/HMSRTCStats.d.ts +18 -0
- package/lib/typescript/classes/HMSRTCStatsReport.d.ts +11 -0
- package/lib/typescript/classes/HMSRemoteAudioStats.d.ts +14 -0
- package/lib/typescript/classes/HMSRemoteVideoStats.d.ts +19 -0
- package/lib/typescript/classes/HMSRoom.d.ts +8 -0
- package/lib/typescript/classes/HMSRoomUpdate.d.ts +8 -1
- package/lib/typescript/classes/HMSRtmpStreamingState.d.ts +4 -0
- package/lib/typescript/classes/HMSSDK.d.ts +325 -14
- package/lib/typescript/classes/HMSServerRecordingState.d.ts +2 -0
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +6 -1
- package/lib/typescript/index.d.ts +14 -0
- package/package.json +1 -2
- package/react-native-hms.podspec +1 -1
- package/src/classes/HMSBrowserRecordingState.ts +10 -1
- package/src/classes/HMSEncoder.ts +193 -3
- package/src/classes/HMSHLSConfig.ts +15 -0
- package/src/classes/HMSHLSMeetingURLVariant.ts +9 -0
- package/src/classes/HMSHLSRecordingConfig.ts +9 -0
- package/src/classes/HMSHLSRecordingState.ts +18 -0
- package/src/classes/HMSHLSStreamingState.ts +11 -0
- package/src/classes/HMSHLSVariant.ts +18 -0
- package/src/classes/HMSLocalAudioStats.ts +15 -0
- package/src/classes/HMSLocalVideoStats.ts +23 -0
- package/src/classes/HMSLogger.ts +17 -3
- package/src/classes/HMSMessage.ts +11 -5
- package/src/classes/HMSMessageRecipient.ts +19 -0
- package/src/classes/HMSMessageRecipientType.ts +5 -0
- package/src/classes/HMSPeerUpdate.ts +1 -7
- package/src/classes/HMSPermissions.ts +3 -3
- package/src/classes/HMSRTCStats.ts +27 -0
- package/src/classes/HMSRTCStatsReport.ts +17 -0
- package/src/classes/HMSRemoteAudioStats.ts +21 -0
- package/src/classes/HMSRemoteVideoStats.ts +29 -0
- package/src/classes/HMSRoom.ts +11 -0
- package/src/classes/HMSRoomUpdate.ts +7 -0
- package/src/classes/HMSRtmpStreamingState.ts +10 -1
- package/src/classes/HMSSDK.tsx +618 -30
- package/src/classes/HMSServerRecordingState.ts +7 -1
- package/src/classes/HMSUpdateListenerActions.ts +5 -0
- package/src/classes/HmsView.tsx +32 -4
- package/src/index.ts +14 -0
|
@@ -46,6 +46,20 @@ export * from './classes/HMSRtmpStreamingState';
|
|
|
46
46
|
export * from './classes/HMSServerRecordingState';
|
|
47
47
|
export * from './classes/HMSBrowserRecordingState';
|
|
48
48
|
export * from './classes/HMSRTMPConfig';
|
|
49
|
+
export * from './classes/HMSHLSConfig';
|
|
50
|
+
export * from './classes/HMSHLSMeetingURLVariant';
|
|
51
|
+
export * from './classes/HMSHLSVariant';
|
|
52
|
+
export * from './classes/HMSHLSStreamingState';
|
|
49
53
|
export * from './classes/HMSVideoResolution';
|
|
54
|
+
export * from './classes/HMSLocalAudioStats';
|
|
55
|
+
export * from './classes/HMSLocalVideoStats';
|
|
56
|
+
export * from './classes/HMSRTCStats';
|
|
57
|
+
export * from './classes/HMSRTCStatsReport';
|
|
58
|
+
export * from './classes/HMSRemoteAudioStats';
|
|
59
|
+
export * from './classes/HMSRemoteVideoStats';
|
|
60
|
+
export * from './classes/HMSHLSRecordingConfig';
|
|
61
|
+
export * from './classes/HMSHLSRecordingState';
|
|
62
|
+
export * from './classes/HMSMessageRecipient';
|
|
63
|
+
export * from './classes/HMSMessageRecipientType';
|
|
50
64
|
import { HMSSDK as HmsManager } from './classes/HMSSDK';
|
|
51
65
|
export default HmsManager;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@100mslive/react-native-hms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "The React Native package for 100ms SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -95,7 +95,6 @@
|
|
|
95
95
|
"prettier": "^2.0.5",
|
|
96
96
|
"react-native-builder-bob": "^0.18.0",
|
|
97
97
|
"release-it": "^14.2.2",
|
|
98
|
-
"typedoc": "^0.22.10",
|
|
99
98
|
"typescript": "^4.1.3"
|
|
100
99
|
},
|
|
101
100
|
"peerDependencies": {
|
package/react-native-hms.podspec
CHANGED
|
@@ -3,9 +3,18 @@ import type { HMSException } from './HMSException';
|
|
|
3
3
|
export class HMSBrowserRecordingState {
|
|
4
4
|
running: string;
|
|
5
5
|
error: HMSException;
|
|
6
|
+
startedAt: Date;
|
|
7
|
+
stoppedAt: Date;
|
|
6
8
|
|
|
7
|
-
constructor(params: {
|
|
9
|
+
constructor(params: {
|
|
10
|
+
running: string;
|
|
11
|
+
error: HMSException;
|
|
12
|
+
startedAt: Date;
|
|
13
|
+
stoppedAt: Date;
|
|
14
|
+
}) {
|
|
8
15
|
this.running = params.running;
|
|
9
16
|
this.error = params.error;
|
|
17
|
+
this.startedAt = params.startedAt;
|
|
18
|
+
this.stoppedAt = params.stoppedAt;
|
|
10
19
|
}
|
|
11
20
|
}
|
|
@@ -15,6 +15,20 @@ import { HMSRole } from './HMSRole';
|
|
|
15
15
|
import { HMSRoleChangeRequest } from './HMSRoleChangeRequest';
|
|
16
16
|
import { HMSChangeTrackStateRequest } from './HMSChangeTrackStateRequest';
|
|
17
17
|
import { HMSVideoResolution } from './HMSVideoResolution';
|
|
18
|
+
import { HMSRTCStats } from './HMSRTCStats';
|
|
19
|
+
import { HMSRTCStatsReport } from './HMSRTCStatsReport';
|
|
20
|
+
import { HMSRemoteAudioTrack } from './HMSRemoteAudioTrack';
|
|
21
|
+
import { HMSRemoteVideoTrack } from './HMSRemoteVideoTrack';
|
|
22
|
+
import { HMSSpeaker } from './HMSSpeaker';
|
|
23
|
+
import { HMSSpeakerUpdate } from './HMSSpeakerUpdate';
|
|
24
|
+
import {
|
|
25
|
+
HMSBrowserRecordingState,
|
|
26
|
+
HMSHLSStreamingState,
|
|
27
|
+
HMSHLSVariant,
|
|
28
|
+
HMSRtmpStreamingState,
|
|
29
|
+
HMSServerRecordingState,
|
|
30
|
+
} from '..';
|
|
31
|
+
import { HMSHLSRecordingState } from './HMSHLSRecordingState';
|
|
18
32
|
|
|
19
33
|
export class HMSEncoder {
|
|
20
34
|
static encodeHmsRoom(room: HMSRoom, id: string) {
|
|
@@ -22,10 +36,23 @@ export class HMSEncoder {
|
|
|
22
36
|
id: room?.id,
|
|
23
37
|
metaData: room?.metaData,
|
|
24
38
|
name: room?.name,
|
|
39
|
+
peerCount: room?.peerCount,
|
|
25
40
|
peers: HMSEncoder.encodeHmsPeers(room?.peers, id),
|
|
26
|
-
browserRecordingState:
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
browserRecordingState: HMSEncoder.encodeBrowserRecordingState(
|
|
42
|
+
room?.browserRecordingState
|
|
43
|
+
),
|
|
44
|
+
rtmpHMSRtmpStreamingState: HMSEncoder.encodeRTMPStreamingState(
|
|
45
|
+
room?.rtmpHMSRtmpStreamingState
|
|
46
|
+
),
|
|
47
|
+
serverRecordingState: HMSEncoder.encodeServerRecordingState(
|
|
48
|
+
room?.serverRecordingState
|
|
49
|
+
),
|
|
50
|
+
hlsStreamingState: HMSEncoder.encodeHLSStreamingState(
|
|
51
|
+
room?.hlsStreamingState
|
|
52
|
+
),
|
|
53
|
+
hlsRecordingState: HMSEncoder.encodeHLSRecordingState(
|
|
54
|
+
room?.hlsRecordingState
|
|
55
|
+
),
|
|
29
56
|
};
|
|
30
57
|
|
|
31
58
|
return new HMSRoom(encodedObj);
|
|
@@ -182,6 +209,34 @@ export class HMSEncoder {
|
|
|
182
209
|
return new HMSVideoResolution(encodedObj);
|
|
183
210
|
}
|
|
184
211
|
|
|
212
|
+
static encodeHmsLocalAudioTrack(track: any, id: string) {
|
|
213
|
+
const encodedObj = {
|
|
214
|
+
id: id,
|
|
215
|
+
trackId: track?.trackId,
|
|
216
|
+
source: track?.source,
|
|
217
|
+
trackDescription: track?.trackDescription,
|
|
218
|
+
isMute: track?.isMute,
|
|
219
|
+
settings: HMSEncoder.encodeHmsAudioTrackSettings(track?.settings),
|
|
220
|
+
type: track?.type,
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
return new HMSLocalAudioTrack(encodedObj);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
static encodeHmsLocalVideoTrack(track: any, id: string) {
|
|
227
|
+
const encodedObj = {
|
|
228
|
+
id: id,
|
|
229
|
+
trackId: track?.trackId,
|
|
230
|
+
source: track?.source,
|
|
231
|
+
trackDescription: track?.trackDescription,
|
|
232
|
+
isMute: track?.isMute,
|
|
233
|
+
settings: HMSEncoder.encodeHmsVideoTrackSettings(track?.settings),
|
|
234
|
+
type: track?.type,
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
return new HMSLocalVideoTrack(encodedObj);
|
|
238
|
+
}
|
|
239
|
+
|
|
185
240
|
static encodeHmsRemotePeers(peers: any, id: string) {
|
|
186
241
|
const hmsPeers: any[] = [];
|
|
187
242
|
|
|
@@ -231,6 +286,33 @@ export class HMSEncoder {
|
|
|
231
286
|
return new HMSRemotePeer(encodedObj);
|
|
232
287
|
}
|
|
233
288
|
|
|
289
|
+
static encodeHmsRemoteAudioTrack(track: any, id: string) {
|
|
290
|
+
const encodedObj = {
|
|
291
|
+
id: id,
|
|
292
|
+
trackId: track?.trackId,
|
|
293
|
+
source: track?.source,
|
|
294
|
+
trackDescription: track?.trackDescription,
|
|
295
|
+
isMute: track?.isMute,
|
|
296
|
+
playbackAllowed: track?.playbackAllowed,
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
return new HMSRemoteAudioTrack(encodedObj);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
static encodeHmsRemoteVideoTrack(track: any, id: string) {
|
|
303
|
+
const encodedObj = {
|
|
304
|
+
id: id,
|
|
305
|
+
trackId: track?.trackId,
|
|
306
|
+
source: track?.source,
|
|
307
|
+
trackDescription: track?.trackDescription,
|
|
308
|
+
layer: track?.layer,
|
|
309
|
+
isMute: track?.isMute,
|
|
310
|
+
playbackAllowed: track?.playbackAllowed,
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
return new HMSRemoteVideoTrack(encodedObj);
|
|
314
|
+
}
|
|
315
|
+
|
|
234
316
|
static encodeHmsPreviewTracks(previewTracks: any) {
|
|
235
317
|
const encodedObj = {
|
|
236
318
|
audioTrack: previewTracks.audioTrack
|
|
@@ -281,4 +363,112 @@ export class HMSEncoder {
|
|
|
281
363
|
|
|
282
364
|
return new HMSChangeTrackStateRequest(encodedChangeTrackStateRequest);
|
|
283
365
|
}
|
|
366
|
+
|
|
367
|
+
static encodeRTCStats(data: any) {
|
|
368
|
+
let video = this.encodeRTCStatsUnit(data?.video);
|
|
369
|
+
let audio = this.encodeRTCStatsUnit(data?.audio);
|
|
370
|
+
let combined = this.encodeRTCStatsUnit(data?.combined);
|
|
371
|
+
|
|
372
|
+
return new HMSRTCStatsReport({ video, audio, combined });
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
static encodeRTCStatsUnit(data: any) {
|
|
376
|
+
return new HMSRTCStats({
|
|
377
|
+
bitrateReceived: data?.bitrateReceived,
|
|
378
|
+
bitrateSent: data?.bitrateSent,
|
|
379
|
+
bytesReceived: data?.bytesReceived,
|
|
380
|
+
bytesSent: data?.bytesSent,
|
|
381
|
+
packetsLost: data?.packetsLost,
|
|
382
|
+
packetsReceived: data?.packetsReceived,
|
|
383
|
+
roundTripTime: data?.roundTripTime,
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
static encodeHmsSpeakerUpdate(data: any, id: string) {
|
|
388
|
+
return new HMSSpeakerUpdate({
|
|
389
|
+
event: data?.event,
|
|
390
|
+
count: data?.count,
|
|
391
|
+
peers: HMSEncoder.encodeHmsSpeakers(data?.peers, id),
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
static encodeHmsSpeakers(data: any, id: string) {
|
|
396
|
+
let encodedSpeakers: Array<HMSSpeaker> = [];
|
|
397
|
+
|
|
398
|
+
data?.map((item: any) => {
|
|
399
|
+
encodedSpeakers.push(HMSEncoder.encodeHmsSpeaker(item, id));
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
return encodedSpeakers;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
static encodeHmsSpeaker(data: any, id: string) {
|
|
406
|
+
return new HMSSpeaker({
|
|
407
|
+
level: data?.level,
|
|
408
|
+
peer: HMSEncoder.encodeHmsPeer(data?.peer, id),
|
|
409
|
+
track: HMSEncoder.encodeHmsTrack(data?.track, id),
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
static encodeBrowserRecordingState(data: any) {
|
|
414
|
+
return new HMSBrowserRecordingState({
|
|
415
|
+
running: data?.running,
|
|
416
|
+
startedAt: new Date(parseInt(data?.startedAt)),
|
|
417
|
+
stoppedAt: new Date(parseInt(data?.stoppedAt)),
|
|
418
|
+
error: data?.error,
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
static encodeServerRecordingState(data: any) {
|
|
423
|
+
return new HMSServerRecordingState({
|
|
424
|
+
running: data?.running,
|
|
425
|
+
error: data?.error,
|
|
426
|
+
startedAt: new Date(parseInt(data?.startedAt)),
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
static encodeRTMPStreamingState(data: any) {
|
|
431
|
+
return new HMSRtmpStreamingState({
|
|
432
|
+
running: data?.running,
|
|
433
|
+
startedAt: new Date(parseInt(data?.startedAt)),
|
|
434
|
+
stoppedAt: new Date(parseInt(data?.stoppedAt)),
|
|
435
|
+
error: data?.error,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
static encodeHLSStreamingState(data: any) {
|
|
440
|
+
return new HMSHLSStreamingState({
|
|
441
|
+
running: data?.running,
|
|
442
|
+
variants: this.encodeHLSVariants(data?.variants),
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
static encodeHLSRecordingState(data: any) {
|
|
447
|
+
if (data) {
|
|
448
|
+
return new HMSHLSRecordingState({
|
|
449
|
+
running: data?.running,
|
|
450
|
+
startedAt: new Date(parseInt(data?.startedAt)),
|
|
451
|
+
singleFilePerLayer: data?.singleFilePerLayer,
|
|
452
|
+
videoOnDemand: data?.videoOnDemand,
|
|
453
|
+
});
|
|
454
|
+
} else {
|
|
455
|
+
return undefined;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
static encodeHLSVariants(data: any) {
|
|
460
|
+
let variants: HMSHLSVariant[] = [];
|
|
461
|
+
|
|
462
|
+
data?.map((item: any) => {
|
|
463
|
+
let variant = new HMSHLSVariant({
|
|
464
|
+
hlsStreamUrl: item.hlsStreamUrl,
|
|
465
|
+
meetingUrl: item.meetingUrl,
|
|
466
|
+
metadata: item?.metadata,
|
|
467
|
+
startedAt: new Date(parseInt(item?.startedAt)),
|
|
468
|
+
});
|
|
469
|
+
variants.push(variant);
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
return variants;
|
|
473
|
+
}
|
|
284
474
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HMSHLSMeetingURLVariant } from './HMSHLSMeetingURLVariant';
|
|
2
|
+
import type { HMSHLSRecordingConfig } from './HMSHLSRecordingConfig';
|
|
3
|
+
|
|
4
|
+
export class HMSHLSConfig {
|
|
5
|
+
hlsRecordingConfig?: HMSHLSRecordingConfig;
|
|
6
|
+
meetingURLVariants: Array<HMSHLSMeetingURLVariant>;
|
|
7
|
+
|
|
8
|
+
constructor(params: {
|
|
9
|
+
hlsRecordingConfig?: HMSHLSRecordingConfig;
|
|
10
|
+
meetingURLVariants: Array<HMSHLSMeetingURLVariant>;
|
|
11
|
+
}) {
|
|
12
|
+
this.hlsRecordingConfig = params.hlsRecordingConfig;
|
|
13
|
+
this.meetingURLVariants = params.meetingURLVariants;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export class HMSHLSRecordingConfig {
|
|
2
|
+
singleFilePerLayer: boolean;
|
|
3
|
+
videoOnDemand: boolean;
|
|
4
|
+
|
|
5
|
+
constructor(params: { singleFilePerLayer: boolean; videoOnDemand: boolean }) {
|
|
6
|
+
this.singleFilePerLayer = params.singleFilePerLayer;
|
|
7
|
+
this.videoOnDemand = params.videoOnDemand;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class HMSHLSRecordingState {
|
|
2
|
+
singleFilePerLayer: boolean;
|
|
3
|
+
videoOnDemand: boolean;
|
|
4
|
+
running: boolean;
|
|
5
|
+
startedAt?: Date;
|
|
6
|
+
|
|
7
|
+
constructor(params: {
|
|
8
|
+
singleFilePerLayer: boolean;
|
|
9
|
+
videoOnDemand: boolean;
|
|
10
|
+
running: boolean;
|
|
11
|
+
startedAt?: Date;
|
|
12
|
+
}) {
|
|
13
|
+
this.singleFilePerLayer = params.singleFilePerLayer;
|
|
14
|
+
this.videoOnDemand = params.videoOnDemand;
|
|
15
|
+
this.running = params.running;
|
|
16
|
+
this.startedAt = params.startedAt;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HMSHLSVariant } from './HMSHLSVariant';
|
|
2
|
+
|
|
3
|
+
export class HMSHLSStreamingState {
|
|
4
|
+
running: boolean;
|
|
5
|
+
variants: Array<HMSHLSVariant>;
|
|
6
|
+
|
|
7
|
+
constructor(params: { running: boolean; variants: Array<HMSHLSVariant> }) {
|
|
8
|
+
this.running = params.running;
|
|
9
|
+
this.variants = params.variants;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class HMSHLSVariant {
|
|
2
|
+
hlsStreamUrl?: string;
|
|
3
|
+
meetingUrl?: string;
|
|
4
|
+
metadata?: string;
|
|
5
|
+
startedAt?: Date;
|
|
6
|
+
|
|
7
|
+
constructor(params: {
|
|
8
|
+
hlsStreamUrl?: string;
|
|
9
|
+
meetingUrl?: string;
|
|
10
|
+
metadata?: string;
|
|
11
|
+
startedAt?: Date;
|
|
12
|
+
}) {
|
|
13
|
+
this.hlsStreamUrl = params.hlsStreamUrl;
|
|
14
|
+
this.meetingUrl = params.meetingUrl;
|
|
15
|
+
this.metadata = params.metadata;
|
|
16
|
+
this.startedAt = params.startedAt;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class HMSLocalAudioStats {
|
|
2
|
+
bitrate?: number;
|
|
3
|
+
bytesSent?: number;
|
|
4
|
+
roundTripTime?: number;
|
|
5
|
+
|
|
6
|
+
constructor(params: {
|
|
7
|
+
bitrate?: number;
|
|
8
|
+
bytesSent?: number;
|
|
9
|
+
roundTripTime?: number;
|
|
10
|
+
}) {
|
|
11
|
+
this.bitrate = params.bitrate;
|
|
12
|
+
this.bytesSent = params.bytesSent;
|
|
13
|
+
this.roundTripTime = params.roundTripTime;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { HMSVideoResolution } from './HMSVideoResolution';
|
|
2
|
+
|
|
3
|
+
export class HMSLocalVideoStats {
|
|
4
|
+
bitrate?: number;
|
|
5
|
+
bytesSent?: number;
|
|
6
|
+
roundTripTime?: number;
|
|
7
|
+
frameRate?: number;
|
|
8
|
+
resolution?: HMSVideoResolution;
|
|
9
|
+
|
|
10
|
+
constructor(params: {
|
|
11
|
+
bitrate?: number;
|
|
12
|
+
bytesSent?: number;
|
|
13
|
+
roundTripTime?: number;
|
|
14
|
+
frameRate?: number;
|
|
15
|
+
resolution?: HMSVideoResolution;
|
|
16
|
+
}) {
|
|
17
|
+
this.bitrate = params.bitrate;
|
|
18
|
+
this.bytesSent = params.bytesSent;
|
|
19
|
+
this.roundTripTime = params.roundTripTime;
|
|
20
|
+
this.frameRate = params.frameRate;
|
|
21
|
+
this.resolution = params.resolution;
|
|
22
|
+
}
|
|
23
|
+
}
|
package/src/classes/HMSLogger.ts
CHANGED
|
@@ -10,6 +10,7 @@ export class HMSLogger {
|
|
|
10
10
|
data: any;
|
|
11
11
|
id: string;
|
|
12
12
|
}[] = [];
|
|
13
|
+
private onLog?: Function;
|
|
13
14
|
|
|
14
15
|
constructor(params?: { verbose: boolean; warning: boolean; error: boolean }) {
|
|
15
16
|
if (params) {
|
|
@@ -22,28 +23,41 @@ export class HMSLogger {
|
|
|
22
23
|
verbose(message: string, data: any) {
|
|
23
24
|
if (this._verbose) {
|
|
24
25
|
console.log(message, data);
|
|
26
|
+
if (this.onLog) {
|
|
27
|
+
this?.onLog({ message, data });
|
|
28
|
+
}
|
|
29
|
+
this.logs.push({ type: 'verbose', message, data, id: data?.id });
|
|
25
30
|
}
|
|
26
|
-
this.logs.push({ type: 'verbose', message, data, id: data?.id });
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
warn(message: string, data: any) {
|
|
30
34
|
if (this._warning) {
|
|
31
35
|
console.warn(message, data);
|
|
36
|
+
if (this.onLog) {
|
|
37
|
+
this?.onLog({ message, data });
|
|
38
|
+
}
|
|
39
|
+
this.logs.push({ type: 'warn', message, data, id: data?.id });
|
|
32
40
|
}
|
|
33
|
-
this.logs.push({ type: 'warn', message, data, id: data?.id });
|
|
34
41
|
}
|
|
35
42
|
|
|
36
43
|
error(message: string, data: any) {
|
|
37
44
|
if (this._error) {
|
|
38
45
|
console.error(message, data);
|
|
46
|
+
if (this.onLog) {
|
|
47
|
+
this?.onLog({ message, data });
|
|
48
|
+
}
|
|
49
|
+
this.logs.push({ type: 'error', message, data, id: data?.id });
|
|
39
50
|
}
|
|
40
|
-
this.logs.push({ type: 'error', message, data, id: data?.id });
|
|
41
51
|
}
|
|
42
52
|
|
|
43
53
|
getLogs() {
|
|
44
54
|
return this.logs;
|
|
45
55
|
}
|
|
46
56
|
|
|
57
|
+
setLogListener(callback: Function) {
|
|
58
|
+
this.onLog = callback;
|
|
59
|
+
}
|
|
60
|
+
|
|
47
61
|
updateLogLevel(level: HMSLogLevel, value: boolean) {
|
|
48
62
|
switch (level) {
|
|
49
63
|
case HMSLogLevel.VERBOSE: {
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
+
import type { HMSMessageRecipient } from './HMSMessageRecipient';
|
|
2
|
+
import type { HMSPeer } from './HMSPeer';
|
|
3
|
+
|
|
1
4
|
export class HMSMessage {
|
|
2
5
|
// endpoint: string;
|
|
3
6
|
public message: string;
|
|
4
7
|
public type: string;
|
|
5
|
-
public time
|
|
6
|
-
public sender
|
|
8
|
+
public time: Date;
|
|
9
|
+
public sender: HMSPeer;
|
|
10
|
+
public recipient: HMSMessageRecipient;
|
|
7
11
|
|
|
8
12
|
constructor(params: {
|
|
9
13
|
message: string;
|
|
10
14
|
type: string;
|
|
11
|
-
time
|
|
12
|
-
sender
|
|
15
|
+
time: string;
|
|
16
|
+
sender: HMSPeer;
|
|
17
|
+
recipient: HMSMessageRecipient;
|
|
13
18
|
}) {
|
|
14
19
|
this.message = params.message;
|
|
15
20
|
this.type = params.type;
|
|
16
|
-
this.time = params.time;
|
|
21
|
+
this.time = new Date(params.time);
|
|
17
22
|
this.sender = params.sender;
|
|
23
|
+
this.recipient = params.recipient;
|
|
18
24
|
}
|
|
19
25
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { HMSMessageRecipientType } from './HMSMessageRecipientType';
|
|
2
|
+
import type { HMSPeer } from './HMSPeer';
|
|
3
|
+
import type { HMSRole } from './HMSRole';
|
|
4
|
+
|
|
5
|
+
export class HMSMessageRecipient {
|
|
6
|
+
public recipientType?: HMSMessageRecipientType;
|
|
7
|
+
public recipientPeer?: HMSPeer;
|
|
8
|
+
public recipientRoles?: HMSRole[];
|
|
9
|
+
|
|
10
|
+
constructor(params: {
|
|
11
|
+
recipientType: HMSMessageRecipientType;
|
|
12
|
+
recipientPeer?: HMSPeer;
|
|
13
|
+
recipientRoles?: HMSRole[];
|
|
14
|
+
}) {
|
|
15
|
+
this.recipientType = params.recipientType;
|
|
16
|
+
this.recipientPeer = params.recipientPeer;
|
|
17
|
+
this.recipientRoles = params.recipientRoles;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
export enum HMSPeerUpdate {
|
|
2
2
|
PEER_JOINED = 'PEER_JOINED',
|
|
3
3
|
PEER_LEFT = 'PEER_LEFT',
|
|
4
|
-
AUDIO_TOGGLED = 'AUDIO_TOGGLED',
|
|
5
|
-
VIDEO_TOGGLED = 'VIDEO_TOGGLED',
|
|
6
4
|
METADATA_CHANGED = 'METADATA_CHANGED',
|
|
7
|
-
BECAME_DOMINANT_SPEAKER = 'BECAME_DOMINANT_SPEAKER',
|
|
8
|
-
NO_DOMINANT_SPEAKER = 'NO_DOMINANT_SPEAKER',
|
|
9
|
-
RESIGNED_DOMINANT_SPEAKER = 'RESIGNED_DOMINANT_SPEAKER',
|
|
10
|
-
STARTED_SPEAKING = 'STARTED_SPEAKING',
|
|
11
|
-
STOPPED_SPEAKING = 'STOPPED_SPEAKING',
|
|
12
5
|
ROLE_CHANGED = 'ROLE_CHANGED',
|
|
6
|
+
NAME_CHANGED = 'NAME_CHANGED',
|
|
13
7
|
}
|
|
@@ -5,7 +5,7 @@ export class HMSPermissions {
|
|
|
5
5
|
mute?: boolean;
|
|
6
6
|
changeRole?: boolean;
|
|
7
7
|
recording?: boolean;
|
|
8
|
-
|
|
8
|
+
streaming?: boolean;
|
|
9
9
|
|
|
10
10
|
constructor(params?: {
|
|
11
11
|
endRoom?: boolean;
|
|
@@ -14,7 +14,7 @@ export class HMSPermissions {
|
|
|
14
14
|
mute?: boolean;
|
|
15
15
|
changeRole?: boolean;
|
|
16
16
|
recording?: boolean;
|
|
17
|
-
|
|
17
|
+
streaming?: boolean;
|
|
18
18
|
}) {
|
|
19
19
|
if (params) {
|
|
20
20
|
this.endRoom = params.endRoom;
|
|
@@ -23,7 +23,7 @@ export class HMSPermissions {
|
|
|
23
23
|
this.mute = params.mute;
|
|
24
24
|
this.changeRole = params.changeRole;
|
|
25
25
|
this.recording = params.recording;
|
|
26
|
-
this.
|
|
26
|
+
this.streaming = params.streaming;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class HMSRTCStats {
|
|
2
|
+
bitrateReceived?: number;
|
|
3
|
+
bitrateSent?: number;
|
|
4
|
+
bytesReceived?: number;
|
|
5
|
+
bytesSent?: number;
|
|
6
|
+
packetsLost?: number;
|
|
7
|
+
packetsReceived?: number;
|
|
8
|
+
roundTripTime?: number;
|
|
9
|
+
|
|
10
|
+
constructor(params: {
|
|
11
|
+
bitrateReceived?: number;
|
|
12
|
+
bitrateSent?: number;
|
|
13
|
+
bytesReceived?: number;
|
|
14
|
+
bytesSent?: number;
|
|
15
|
+
packetsLost?: number;
|
|
16
|
+
packetsReceived?: number;
|
|
17
|
+
roundTripTime?: number;
|
|
18
|
+
}) {
|
|
19
|
+
this.bitrateReceived = params.bitrateReceived;
|
|
20
|
+
this.bitrateSent = params.bitrateSent;
|
|
21
|
+
this.bytesReceived = params.bytesReceived;
|
|
22
|
+
this.bytesSent = params.bytesSent;
|
|
23
|
+
this.packetsLost = params.packetsLost;
|
|
24
|
+
this.packetsReceived = params.packetsReceived;
|
|
25
|
+
this.roundTripTime = params.roundTripTime;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HMSRTCStats } from './HMSRTCStats';
|
|
2
|
+
|
|
3
|
+
export class HMSRTCStatsReport {
|
|
4
|
+
video?: HMSRTCStats;
|
|
5
|
+
audio?: HMSRTCStats;
|
|
6
|
+
combined?: HMSRTCStats;
|
|
7
|
+
|
|
8
|
+
constructor(params: {
|
|
9
|
+
video?: HMSRTCStats;
|
|
10
|
+
audio?: HMSRTCStats;
|
|
11
|
+
combined?: HMSRTCStats;
|
|
12
|
+
}) {
|
|
13
|
+
this.audio = params.audio;
|
|
14
|
+
this.video = params.video;
|
|
15
|
+
this.combined = params.combined;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class HMSRemoteAudioStats {
|
|
2
|
+
bitrate?: number;
|
|
3
|
+
packetsReceived?: number;
|
|
4
|
+
packetsLost?: number;
|
|
5
|
+
bytesReceived?: number;
|
|
6
|
+
jitter?: number;
|
|
7
|
+
|
|
8
|
+
constructor(params: {
|
|
9
|
+
bitrate?: number;
|
|
10
|
+
packetsReceived?: number;
|
|
11
|
+
packetsLost?: number;
|
|
12
|
+
bytesReceived?: number;
|
|
13
|
+
jitter?: number;
|
|
14
|
+
}) {
|
|
15
|
+
this.bitrate = params.bitrate;
|
|
16
|
+
this.packetsReceived = params.packetsReceived;
|
|
17
|
+
this.jitter = params.jitter;
|
|
18
|
+
this.packetsLost = params.packetsLost;
|
|
19
|
+
this.bytesReceived = params.bytesReceived;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { HMSVideoResolution } from './HMSVideoResolution';
|
|
2
|
+
|
|
3
|
+
export class HMSRemoteVideoStats {
|
|
4
|
+
bitrate?: number;
|
|
5
|
+
packetsReceived?: number;
|
|
6
|
+
packetsLost?: number;
|
|
7
|
+
bytesReceived?: number;
|
|
8
|
+
jitter?: number;
|
|
9
|
+
resolution?: HMSVideoResolution;
|
|
10
|
+
frameRate?: number;
|
|
11
|
+
|
|
12
|
+
constructor(params: {
|
|
13
|
+
bitrate?: number;
|
|
14
|
+
packetsReceived?: number;
|
|
15
|
+
packetsLost?: number;
|
|
16
|
+
bytesReceived?: number;
|
|
17
|
+
jitter?: number;
|
|
18
|
+
resolution?: HMSVideoResolution;
|
|
19
|
+
frameRate?: number;
|
|
20
|
+
}) {
|
|
21
|
+
this.bitrate = params.bitrate;
|
|
22
|
+
this.packetsReceived = params.packetsReceived;
|
|
23
|
+
this.packetsLost = params.packetsLost;
|
|
24
|
+
this.bytesReceived = params.bytesReceived;
|
|
25
|
+
this.jitter = params.jitter;
|
|
26
|
+
this.resolution = params.resolution;
|
|
27
|
+
this.frameRate = params.frameRate;
|
|
28
|
+
}
|
|
29
|
+
}
|