@100mslive/react-native-hms 0.9.1 → 0.9.4
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 +239 -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/build.gradle +1 -1
- package/android/src/main/java/com/reactnativehmssdk/HmsDecoder.kt +22 -0
- package/android/src/main/java/com/reactnativehmssdk/HmsHelper.kt +197 -6
- package/android/src/main/java/com/reactnativehmssdk/HmsModule.kt +2 -2
- package/android/src/main/java/com/reactnativehmssdk/HmsSDK.kt +36 -77
- package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +16 -0
- package/android/src/main/java/com/reactnativehmssdk/HmsView.kt +24 -33
- package/android/src/main/java/com/reactnativehmssdk/HmssdkViewManager.kt +15 -2
- package/ios/HmsDecoder.swift +47 -4
- package/ios/HmsHelper.swift +14 -0
- package/ios/HmsSDK.swift +13 -7
- package/lib/commonjs/classes/HMSConfig.js +3 -0
- package/lib/commonjs/classes/HMSConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSEncoder.js +33 -2
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSConfig.js +3 -0
- package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -1
- 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/HMSLocalPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSLogger.js +21 -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/HMSNetworkQuality.js +20 -0
- package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -0
- package/lib/commonjs/classes/HMSPeer.js +3 -0
- package/lib/commonjs/classes/HMSPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSPeerUpdate.js +1 -8
- package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
- package/lib/commonjs/classes/HMSRoom.js +3 -0
- package/lib/commonjs/classes/HMSRoom.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +22 -7
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +10 -6
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/index.js +70 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/classes/HMSConfig.js +3 -0
- package/lib/module/classes/HMSConfig.js.map +1 -1
- package/lib/module/classes/HMSEncoder.js +31 -2
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSHLSConfig.js +3 -0
- package/lib/module/classes/HMSHLSConfig.js.map +1 -1
- 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/HMSLocalPeer.js.map +1 -1
- package/lib/module/classes/HMSLogger.js +21 -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/HMSNetworkQuality.js +11 -0
- package/lib/module/classes/HMSNetworkQuality.js.map +1 -0
- package/lib/module/classes/HMSPeer.js +3 -0
- package/lib/module/classes/HMSPeer.js.map +1 -1
- package/lib/module/classes/HMSPeerUpdate.js +1 -8
- package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/module/classes/HMSRemotePeer.js.map +1 -1
- package/lib/module/classes/HMSRoom.js +3 -0
- package/lib/module/classes/HMSRoom.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +22 -6
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HmsView.js +10 -6
- 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/HMSConfig.d.ts +2 -0
- package/lib/typescript/classes/HMSEncoder.d.ts +4 -0
- package/lib/typescript/classes/HMSHLSConfig.d.ts +5 -2
- package/lib/typescript/classes/HMSHLSRecordingConfig.d.ts +8 -0
- package/lib/typescript/classes/HMSHLSRecordingState.d.ts +12 -0
- package/lib/typescript/classes/HMSLocalPeer.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/HMSNetworkQuality.d.ts +6 -0
- package/lib/typescript/classes/HMSPeer.d.ts +3 -0
- package/lib/typescript/classes/HMSPeerUpdate.d.ts +1 -8
- package/lib/typescript/classes/HMSRemotePeer.d.ts +2 -0
- package/lib/typescript/classes/HMSRoom.d.ts +3 -0
- package/lib/typescript/classes/HMSSDK.d.ts +299 -10
- package/lib/typescript/classes/HmsView.d.ts +4 -2
- package/lib/typescript/index.d.ts +5 -0
- package/package.json +1 -1
- package/react-native-hms.podspec +1 -1
- package/src/classes/HMSConfig.ts +3 -0
- package/src/classes/HMSEncoder.ts +62 -17
- package/src/classes/HMSHLSConfig.ts +8 -2
- package/src/classes/HMSHLSRecordingConfig.ts +9 -0
- package/src/classes/HMSHLSRecordingState.ts +18 -0
- package/src/classes/HMSLocalPeer.ts +2 -0
- package/src/classes/HMSLogger.ts +3 -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/HMSNetworkQuality.ts +7 -0
- package/src/classes/HMSPeer.ts +4 -2
- package/src/classes/HMSPeerUpdate.ts +1 -8
- package/src/classes/HMSRemotePeer.ts +2 -0
- package/src/classes/HMSRoom.ts +4 -0
- package/src/classes/HMSSDK.tsx +306 -11
- package/src/classes/HmsView.tsx +14 -6
- package/src/index.ts +5 -0
package/src/classes/HMSConfig.ts
CHANGED
|
@@ -3,16 +3,19 @@ export class HMSConfig {
|
|
|
3
3
|
authToken: string;
|
|
4
4
|
endpoint?: string;
|
|
5
5
|
metadata?: string;
|
|
6
|
+
captureNetworkQualityInPreview?: boolean;
|
|
6
7
|
|
|
7
8
|
constructor(params: {
|
|
8
9
|
username: string;
|
|
9
10
|
authToken: string;
|
|
10
11
|
endpoint?: string;
|
|
11
12
|
metadata?: string;
|
|
13
|
+
captureNetworkQualityInPreview?: boolean;
|
|
12
14
|
}) {
|
|
13
15
|
this.username = params.username;
|
|
14
16
|
this.authToken = params.authToken;
|
|
15
17
|
this.endpoint = params.endpoint;
|
|
16
18
|
this.metadata = params.metadata;
|
|
19
|
+
this.captureNetworkQualityInPreview = params.captureNetworkQualityInPreview;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
@@ -21,7 +21,15 @@ import { HMSRemoteAudioTrack } from './HMSRemoteAudioTrack';
|
|
|
21
21
|
import { HMSRemoteVideoTrack } from './HMSRemoteVideoTrack';
|
|
22
22
|
import { HMSSpeaker } from './HMSSpeaker';
|
|
23
23
|
import { HMSSpeakerUpdate } from './HMSSpeakerUpdate';
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
HMSBrowserRecordingState,
|
|
26
|
+
HMSHLSStreamingState,
|
|
27
|
+
HMSHLSVariant,
|
|
28
|
+
HMSRtmpStreamingState,
|
|
29
|
+
HMSServerRecordingState,
|
|
30
|
+
} from '..';
|
|
31
|
+
import { HMSHLSRecordingState } from './HMSHLSRecordingState';
|
|
32
|
+
import { HMSNetworkQuality } from './HMSNetworkQuality';
|
|
25
33
|
|
|
26
34
|
export class HMSEncoder {
|
|
27
35
|
static encodeHmsRoom(room: HMSRoom, id: string) {
|
|
@@ -31,10 +39,21 @@ export class HMSEncoder {
|
|
|
31
39
|
name: room?.name,
|
|
32
40
|
peerCount: room?.peerCount,
|
|
33
41
|
peers: HMSEncoder.encodeHmsPeers(room?.peers, id),
|
|
34
|
-
browserRecordingState: HMSEncoder.encodeBrowserRecordingState(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
browserRecordingState: HMSEncoder.encodeBrowserRecordingState(
|
|
43
|
+
room?.browserRecordingState
|
|
44
|
+
),
|
|
45
|
+
rtmpHMSRtmpStreamingState: HMSEncoder.encodeRTMPStreamingState(
|
|
46
|
+
room?.rtmpHMSRtmpStreamingState
|
|
47
|
+
),
|
|
48
|
+
serverRecordingState: HMSEncoder.encodeServerRecordingState(
|
|
49
|
+
room?.serverRecordingState
|
|
50
|
+
),
|
|
51
|
+
hlsStreamingState: HMSEncoder.encodeHLSStreamingState(
|
|
52
|
+
room?.hlsStreamingState
|
|
53
|
+
),
|
|
54
|
+
hlsRecordingState: HMSEncoder.encodeHLSRecordingState(
|
|
55
|
+
room?.hlsRecordingState
|
|
56
|
+
),
|
|
38
57
|
};
|
|
39
58
|
|
|
40
59
|
return new HMSRoom(encodedObj);
|
|
@@ -54,10 +73,11 @@ export class HMSEncoder {
|
|
|
54
73
|
peerID: peer?.peerID,
|
|
55
74
|
name: peer?.name,
|
|
56
75
|
isLocal: peer?.isLocal,
|
|
57
|
-
role: HMSEncoder.encodeHmsRole(peer?.role),
|
|
58
76
|
customerUserID: peer?.customerUserID,
|
|
59
77
|
customerDescription: peer?.customerDescription,
|
|
60
78
|
metadata: peer?.metadata,
|
|
79
|
+
role: HMSEncoder.encodeHmsRole(peer?.role),
|
|
80
|
+
networkQuality: HMSEncoder.encodeHMSNetworkQuality(peer?.networkQuality),
|
|
61
81
|
audioTrack: HMSEncoder.encodeHmsAudioTrack(peer?.audioTrack, id),
|
|
62
82
|
videoTrack: HMSEncoder.encodeHmsVideoTrack(peer?.videoTrack, id),
|
|
63
83
|
auxiliaryTracks: HMSEncoder.encodeHmsAuxiliaryTracks(
|
|
@@ -126,6 +146,7 @@ export class HMSEncoder {
|
|
|
126
146
|
customerDescription: peer.customerDescription,
|
|
127
147
|
metadata: peer.metadata,
|
|
128
148
|
role: HMSEncoder.encodeHmsRole(peer?.role),
|
|
149
|
+
networkQuality: HMSEncoder.encodeHMSNetworkQuality(peer?.networkQuality),
|
|
129
150
|
audioTrack: HMSEncoder.encodeHmsAudioTrack(peer.audioTrack, id),
|
|
130
151
|
videoTrack: HMSEncoder.encodeHmsVideoTrack(peer.videoTrack, id),
|
|
131
152
|
auxiliaryTracks: HMSEncoder.encodeHmsAuxiliaryTracks(
|
|
@@ -240,6 +261,7 @@ export class HMSEncoder {
|
|
|
240
261
|
customerDescription: peer.customerDescription,
|
|
241
262
|
metadata: peer.metadata,
|
|
242
263
|
role: HMSEncoder.encodeHmsRole(peer?.role),
|
|
264
|
+
networkQuality: HMSEncoder.encodeHMSNetworkQuality(peer?.networkQuality),
|
|
243
265
|
audioTrack: HMSEncoder.encodeHmsAudioTrack(peer.audioTrack, id),
|
|
244
266
|
videoTrack: HMSEncoder.encodeHmsVideoTrack(peer.videoTrack, id),
|
|
245
267
|
auxiliaryTracks: HMSEncoder.encodeHmsAuxiliaryTracks(
|
|
@@ -398,15 +420,15 @@ export class HMSEncoder {
|
|
|
398
420
|
startedAt: new Date(parseInt(data?.startedAt)),
|
|
399
421
|
stoppedAt: new Date(parseInt(data?.stoppedAt)),
|
|
400
422
|
error: data?.error,
|
|
401
|
-
})
|
|
423
|
+
});
|
|
402
424
|
}
|
|
403
425
|
|
|
404
426
|
static encodeServerRecordingState(data: any) {
|
|
405
427
|
return new HMSServerRecordingState({
|
|
406
428
|
running: data?.running,
|
|
407
429
|
error: data?.error,
|
|
408
|
-
startedAt: new Date(parseInt(data?.startedAt))
|
|
409
|
-
})
|
|
430
|
+
startedAt: new Date(parseInt(data?.startedAt)),
|
|
431
|
+
});
|
|
410
432
|
}
|
|
411
433
|
|
|
412
434
|
static encodeRTMPStreamingState(data: any) {
|
|
@@ -414,30 +436,53 @@ export class HMSEncoder {
|
|
|
414
436
|
running: data?.running,
|
|
415
437
|
startedAt: new Date(parseInt(data?.startedAt)),
|
|
416
438
|
stoppedAt: new Date(parseInt(data?.stoppedAt)),
|
|
417
|
-
error: data?.error
|
|
418
|
-
})
|
|
439
|
+
error: data?.error,
|
|
440
|
+
});
|
|
419
441
|
}
|
|
420
442
|
|
|
421
443
|
static encodeHLSStreamingState(data: any) {
|
|
422
444
|
return new HMSHLSStreamingState({
|
|
423
445
|
running: data?.running,
|
|
424
|
-
variants: this.encodeHLSVariants(data?.variants)
|
|
425
|
-
})
|
|
446
|
+
variants: this.encodeHLSVariants(data?.variants),
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
static encodeHLSRecordingState(data: any) {
|
|
451
|
+
if (data) {
|
|
452
|
+
return new HMSHLSRecordingState({
|
|
453
|
+
running: data?.running,
|
|
454
|
+
startedAt: new Date(parseInt(data?.startedAt)),
|
|
455
|
+
singleFilePerLayer: data?.singleFilePerLayer,
|
|
456
|
+
videoOnDemand: data?.videoOnDemand,
|
|
457
|
+
});
|
|
458
|
+
} else {
|
|
459
|
+
return undefined;
|
|
460
|
+
}
|
|
426
461
|
}
|
|
427
462
|
|
|
428
463
|
static encodeHLSVariants(data: any) {
|
|
429
|
-
let variants: HMSHLSVariant[] = []
|
|
464
|
+
let variants: HMSHLSVariant[] = [];
|
|
430
465
|
|
|
431
466
|
data?.map((item: any) => {
|
|
432
467
|
let variant = new HMSHLSVariant({
|
|
433
468
|
hlsStreamUrl: item.hlsStreamUrl,
|
|
434
469
|
meetingUrl: item.meetingUrl,
|
|
435
470
|
metadata: item?.metadata,
|
|
436
|
-
startedAt: new Date(parseInt(item?.startedAt))
|
|
437
|
-
})
|
|
471
|
+
startedAt: new Date(parseInt(item?.startedAt)),
|
|
472
|
+
});
|
|
438
473
|
variants.push(variant);
|
|
439
|
-
})
|
|
474
|
+
});
|
|
440
475
|
|
|
441
476
|
return variants;
|
|
442
477
|
}
|
|
478
|
+
|
|
479
|
+
static encodeHMSNetworkQuality(data: any) {
|
|
480
|
+
if (data) {
|
|
481
|
+
return new HMSNetworkQuality({
|
|
482
|
+
downlinkQuality: data?.downlinkQuality,
|
|
483
|
+
});
|
|
484
|
+
} else {
|
|
485
|
+
return undefined;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
443
488
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { HMSHLSMeetingURLVariant } from './HMSHLSMeetingURLVariant';
|
|
2
|
+
import type { HMSHLSRecordingConfig } from './HMSHLSRecordingConfig';
|
|
2
3
|
|
|
3
4
|
export class HMSHLSConfig {
|
|
4
|
-
|
|
5
|
+
hlsRecordingConfig?: HMSHLSRecordingConfig;
|
|
6
|
+
meetingURLVariants: Array<HMSHLSMeetingURLVariant>;
|
|
5
7
|
|
|
6
|
-
constructor(params: {
|
|
8
|
+
constructor(params: {
|
|
9
|
+
hlsRecordingConfig?: HMSHLSRecordingConfig;
|
|
10
|
+
meetingURLVariants: Array<HMSHLSMeetingURLVariant>;
|
|
11
|
+
}) {
|
|
12
|
+
this.hlsRecordingConfig = params.hlsRecordingConfig;
|
|
7
13
|
this.meetingURLVariants = params.meetingURLVariants;
|
|
8
14
|
}
|
|
9
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
|
+
}
|
|
@@ -8,6 +8,7 @@ import { HMSLocalAudioTrack } from './HMSLocalAudioTrack';
|
|
|
8
8
|
import { HMSLocalVideoTrack } from './HMSLocalVideoTrack';
|
|
9
9
|
import type { HMSRole } from './HMSRole';
|
|
10
10
|
import type { HMSTrackType } from './HMSTrackType';
|
|
11
|
+
import type { HMSNetworkQuality } from './HMSNetworkQuality';
|
|
11
12
|
|
|
12
13
|
export class HMSLocalPeer extends HMSPeer {
|
|
13
14
|
private localAudio?: HMSLocalAudioTrack;
|
|
@@ -29,6 +30,7 @@ export class HMSLocalPeer extends HMSPeer {
|
|
|
29
30
|
metadata?: string;
|
|
30
31
|
audioTrack?: HMSAudioTrack;
|
|
31
32
|
videoTrack?: HMSVideoTrack;
|
|
33
|
+
networkQuality?: HMSNetworkQuality;
|
|
32
34
|
role?: HMSRole;
|
|
33
35
|
auxiliaryTracks?: HMSTrack[];
|
|
34
36
|
localAudioTrackData?: {
|
package/src/classes/HMSLogger.ts
CHANGED
|
@@ -26,8 +26,8 @@ export class HMSLogger {
|
|
|
26
26
|
if (this.onLog) {
|
|
27
27
|
this?.onLog({ message, data });
|
|
28
28
|
}
|
|
29
|
+
this.logs.push({ type: 'verbose', message, data, id: data?.id });
|
|
29
30
|
}
|
|
30
|
-
this.logs.push({ type: 'verbose', message, data, id: data?.id });
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
warn(message: string, data: any) {
|
|
@@ -36,8 +36,8 @@ export class HMSLogger {
|
|
|
36
36
|
if (this.onLog) {
|
|
37
37
|
this?.onLog({ message, data });
|
|
38
38
|
}
|
|
39
|
+
this.logs.push({ type: 'warn', message, data, id: data?.id });
|
|
39
40
|
}
|
|
40
|
-
this.logs.push({ type: 'warn', message, data, id: data?.id });
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
error(message: string, data: any) {
|
|
@@ -46,8 +46,8 @@ export class HMSLogger {
|
|
|
46
46
|
if (this.onLog) {
|
|
47
47
|
this?.onLog({ message, data });
|
|
48
48
|
}
|
|
49
|
+
this.logs.push({ type: 'error', message, data, id: data?.id });
|
|
49
50
|
}
|
|
50
|
-
this.logs.push({ type: 'error', message, data, id: data?.id });
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
getLogs() {
|
|
@@ -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
|
+
}
|
package/src/classes/HMSPeer.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HMSAudioTrack } from './HMSAudioTrack';
|
|
2
|
+
import type { HMSNetworkQuality } from './HMSNetworkQuality';
|
|
2
3
|
import type { HMSRole } from './HMSRole';
|
|
3
4
|
import type { HMSTrack } from './HMSTrack';
|
|
4
5
|
import type { HMSVideoTrack } from './HMSVideoTrack';
|
|
@@ -11,10 +12,9 @@ export class HMSPeer {
|
|
|
11
12
|
customerDescription?: string;
|
|
12
13
|
metadata?: string;
|
|
13
14
|
role?: HMSRole;
|
|
14
|
-
|
|
15
|
+
networkQuality?: HMSNetworkQuality;
|
|
15
16
|
audioTrack?: HMSAudioTrack;
|
|
16
17
|
videoTrack?: HMSVideoTrack;
|
|
17
|
-
|
|
18
18
|
auxiliaryTracks?: HMSTrack[];
|
|
19
19
|
|
|
20
20
|
constructor(params: {
|
|
@@ -25,6 +25,7 @@ export class HMSPeer {
|
|
|
25
25
|
customerDescription?: string;
|
|
26
26
|
metadata?: string;
|
|
27
27
|
role?: HMSRole;
|
|
28
|
+
networkQuality?: HMSNetworkQuality;
|
|
28
29
|
audioTrack?: HMSAudioTrack;
|
|
29
30
|
videoTrack?: HMSVideoTrack;
|
|
30
31
|
auxiliaryTracks?: HMSTrack[];
|
|
@@ -38,6 +39,7 @@ export class HMSPeer {
|
|
|
38
39
|
this.videoTrack = params.videoTrack;
|
|
39
40
|
this.auxiliaryTracks = params.auxiliaryTracks;
|
|
40
41
|
this.role = params.role;
|
|
42
|
+
this.networkQuality = params.networkQuality;
|
|
41
43
|
this.metadata = params.metadata;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
@@ -1,15 +1,8 @@
|
|
|
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',
|
|
13
6
|
NAME_CHANGED = 'NAME_CHANGED',
|
|
14
|
-
|
|
7
|
+
NETWORK_QUALITY_UPDATED = 'NETWORK_QUALITY_UPDATED',
|
|
15
8
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HMSAudioTrack } from './HMSAudioTrack';
|
|
2
|
+
import type { HMSNetworkQuality } from './HMSNetworkQuality';
|
|
2
3
|
import { HMSPeer } from './HMSPeer';
|
|
3
4
|
import { HMSRemoteAudioTrack } from './HMSRemoteAudioTrack';
|
|
4
5
|
import { HMSRemoteVideoTrack } from './HMSRemoteVideoTrack';
|
|
@@ -28,6 +29,7 @@ export class HMSRemotePeer extends HMSPeer {
|
|
|
28
29
|
audioTrack?: HMSAudioTrack;
|
|
29
30
|
videoTrack?: HMSVideoTrack;
|
|
30
31
|
role?: HMSRole;
|
|
32
|
+
networkQuality?: HMSNetworkQuality;
|
|
31
33
|
auxiliaryTracks?: HMSTrack[];
|
|
32
34
|
remoteAudioTrackData?: {
|
|
33
35
|
trackId: string;
|
package/src/classes/HMSRoom.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { HMSRtmpStreamingState } from './HMSRtmpStreamingState';
|
|
|
3
3
|
import type { HMSServerRecordingState } from './HMSServerRecordingState';
|
|
4
4
|
import type { HMSBrowserRecordingState } from './HMSBrowserRecordingState';
|
|
5
5
|
import type { HMSHLSStreamingState } from './HMSHLSStreamingState';
|
|
6
|
+
import type { HMSHLSRecordingState } from './HMSHLSRecordingState';
|
|
6
7
|
|
|
7
8
|
export class HMSRoom {
|
|
8
9
|
id: string;
|
|
@@ -13,6 +14,7 @@ export class HMSRoom {
|
|
|
13
14
|
rtmpHMSRtmpStreamingState: HMSRtmpStreamingState;
|
|
14
15
|
serverRecordingState: HMSServerRecordingState;
|
|
15
16
|
hlsStreamingState: HMSHLSStreamingState;
|
|
17
|
+
hlsRecordingState?: HMSHLSRecordingState;
|
|
16
18
|
peerCount: number;
|
|
17
19
|
|
|
18
20
|
constructor(params: {
|
|
@@ -24,6 +26,7 @@ export class HMSRoom {
|
|
|
24
26
|
rtmpHMSRtmpStreamingState: HMSRtmpStreamingState;
|
|
25
27
|
serverRecordingState: HMSServerRecordingState;
|
|
26
28
|
hlsStreamingState: HMSHLSStreamingState;
|
|
29
|
+
hlsRecordingState?: HMSHLSRecordingState;
|
|
27
30
|
peerCount: number;
|
|
28
31
|
}) {
|
|
29
32
|
this.id = params.id;
|
|
@@ -34,6 +37,7 @@ export class HMSRoom {
|
|
|
34
37
|
this.rtmpHMSRtmpStreamingState = params.rtmpHMSRtmpStreamingState;
|
|
35
38
|
this.serverRecordingState = params.serverRecordingState;
|
|
36
39
|
this.hlsStreamingState = params.hlsStreamingState;
|
|
40
|
+
this.hlsRecordingState = params.hlsRecordingState;
|
|
37
41
|
this.peerCount = params.peerCount;
|
|
38
42
|
}
|
|
39
43
|
}
|