@100mslive/react-native-hms 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- 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 +2 -2
- package/android/local.properties +8 -0
- package/android/src/main/java/com/reactnativehmssdk/HmsDecoder.kt +31 -4
- package/android/src/main/java/com/reactnativehmssdk/HmsHelper.kt +16 -64
- package/android/src/main/java/com/reactnativehmssdk/HmsModule.kt +17 -3
- package/android/src/main/java/com/reactnativehmssdk/HmsSDK.kt +97 -32
- package/android/src/main/java/com/reactnativehmssdk/HmsView.kt +1 -1
- package/ios/HmsDecoder.swift +173 -135
- package/ios/HmsHelper.swift +38 -41
- package/ios/HmsManager.m +7 -1
- package/ios/HmsManager.swift +111 -68
- package/ios/HmsSDK.swift +335 -199
- package/ios/HmsView.swift +45 -31
- 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 +164 -4
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSVariant.js.map +1 -1
- 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/HMSPeerUpdate.js +2 -0
- 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 +3 -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/HMSRtmpStreamingState.js +6 -0
- package/lib/commonjs/classes/HMSRtmpStreamingState.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +365 -111
- 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/index.js +84 -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 +157 -4
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSHLSVariant.js.map +1 -1
- 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/HMSPeerUpdate.js +2 -0
- 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 +3 -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/HMSRtmpStreamingState.js +6 -0
- package/lib/module/classes/HMSRtmpStreamingState.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +352 -111
- 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/index.js +6 -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 +21 -0
- package/lib/typescript/classes/HMSHLSVariant.d.ts +8 -8
- package/lib/typescript/classes/HMSLocalAudioStats.d.ts +10 -0
- package/lib/typescript/classes/HMSLocalVideoStats.d.ts +15 -0
- package/lib/typescript/classes/HMSPeerUpdate.d.ts +3 -1
- 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 +2 -0
- package/lib/typescript/classes/HMSRoomUpdate.d.ts +2 -1
- package/lib/typescript/classes/HMSRtmpStreamingState.d.ts +4 -0
- package/lib/typescript/classes/HMSSDK.d.ts +16 -1
- package/lib/typescript/classes/HMSServerRecordingState.d.ts +2 -0
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +6 -1
- package/lib/typescript/index.d.ts +6 -0
- package/package.json +1 -1
- package/react-native-hms.podspec +1 -1
- package/src/classes/HMSBrowserRecordingState.ts +10 -1
- package/src/classes/HMSEncoder.ts +162 -4
- package/src/classes/HMSHLSVariant.ts +8 -8
- package/src/classes/HMSLocalAudioStats.ts +15 -0
- package/src/classes/HMSLocalVideoStats.ts +23 -0
- package/src/classes/HMSPeerUpdate.ts +2 -0
- 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 +3 -0
- package/src/classes/HMSRoomUpdate.ts +1 -0
- package/src/classes/HMSRtmpStreamingState.ts +10 -1
- package/src/classes/HMSSDK.tsx +233 -10
- package/src/classes/HMSServerRecordingState.ts +7 -1
- package/src/classes/HMSUpdateListenerActions.ts +5 -0
- package/src/index.ts +6 -0
|
@@ -43,6 +43,11 @@ export declare class HMSSDK {
|
|
|
43
43
|
onRoleChangeRequestDelegate?: any;
|
|
44
44
|
onChangeTrackStateRequestDelegate?: any;
|
|
45
45
|
onRemovedFromRoomDelegate?: any;
|
|
46
|
+
onRtcStatsDelegate?: any;
|
|
47
|
+
onLocalAudioStatsDelegate?: any;
|
|
48
|
+
onLocalVideoStatsDelegate?: any;
|
|
49
|
+
onRemoteAudioStatsDelegate?: any;
|
|
50
|
+
onRemoteVideoStatsDelegate?: any;
|
|
46
51
|
constructor(id: string);
|
|
47
52
|
/**
|
|
48
53
|
* - Returns an instance of [HMSSDK]{@link HMSSDK}
|
|
@@ -70,6 +75,7 @@ export declare class HMSSDK {
|
|
|
70
75
|
*/
|
|
71
76
|
join: (config: HMSConfig) => Promise<void>;
|
|
72
77
|
preview: (config: HMSConfig) => void;
|
|
78
|
+
previewForRole: (role: HMSRole) => Promise<any>;
|
|
73
79
|
HmsView: ({ sink, trackId, style, mirror, scaleType, }: HmsComponentProps) => JSX.Element;
|
|
74
80
|
/**
|
|
75
81
|
* Calls leave function of native sdk and session of current user is invalidated
|
|
@@ -90,8 +96,10 @@ export declare class HMSSDK {
|
|
|
90
96
|
changeTrackStateForRoles: (mute: boolean, type?: HMSTrackType | undefined, source?: string | undefined, roles?: HMSRole[] | undefined) => Promise<any>;
|
|
91
97
|
removePeer: (peer: HMSPeer, reason: string) => Promise<any>;
|
|
92
98
|
endRoom: (reason: string, lock?: boolean) => Promise<any>;
|
|
99
|
+
changeName: (name: string) => Promise<any>;
|
|
93
100
|
acceptRoleChange: () => Promise<any>;
|
|
94
|
-
|
|
101
|
+
setPlaybackForAllAudio: (mute: boolean) => void;
|
|
102
|
+
remoteMuteAllAudio: () => void;
|
|
95
103
|
getRoom: () => Promise<HMSRoom>;
|
|
96
104
|
setVolume: (track: HMSTrack, volume: number) => void;
|
|
97
105
|
resetVolume: () => void;
|
|
@@ -99,6 +107,8 @@ export declare class HMSSDK {
|
|
|
99
107
|
startScreenshare: () => void;
|
|
100
108
|
isScreenShared: () => Promise<any>;
|
|
101
109
|
stopScreenshare: () => Promise<any>;
|
|
110
|
+
enableRTCStats: () => void;
|
|
111
|
+
disableRTCStats: () => void;
|
|
102
112
|
/**
|
|
103
113
|
* - This is a prototype event listener that takes action and listens for updates related to that particular action
|
|
104
114
|
* - This method will be @deprecated in future and event listener will be passed in join method
|
|
@@ -136,5 +146,10 @@ export declare class HMSSDK {
|
|
|
136
146
|
onRemovedFromRoomListener: (data: any) => void;
|
|
137
147
|
reconnectingListener: (data: any) => void;
|
|
138
148
|
reconnectedListener: (data: any) => void;
|
|
149
|
+
RTCStatsListener: (data: any) => void;
|
|
150
|
+
onLocalAudioStatsListener: (data: any) => void;
|
|
151
|
+
onLocalVideoStatsListener: (data: any) => void;
|
|
152
|
+
onRemoteAudioStatsListener: (data: any) => void;
|
|
153
|
+
onRemoteVideoStatsListener: (data: any) => void;
|
|
139
154
|
}
|
|
140
155
|
export {};
|
|
@@ -11,5 +11,10 @@ export declare enum HMSUpdateListenerActions {
|
|
|
11
11
|
RECONNECTED = "RECONNECTED",
|
|
12
12
|
ON_ROLE_CHANGE_REQUEST = "ON_ROLE_CHANGE_REQUEST",
|
|
13
13
|
ON_CHANGE_TRACK_STATE_REQUEST = "ON_CHANGE_TRACK_STATE_REQUEST",
|
|
14
|
-
ON_REMOVED_FROM_ROOM = "ON_REMOVED_FROM_ROOM"
|
|
14
|
+
ON_REMOVED_FROM_ROOM = "ON_REMOVED_FROM_ROOM",
|
|
15
|
+
ON_RTC_STATS = "ON_RTC_STATS",
|
|
16
|
+
ON_LOCAL_AUDIO_STATS = "ON_LOCAL_AUDIO_STATS",
|
|
17
|
+
ON_LOCAL_VIDEO_STATS = "ON_LOCAL_VIDEO_STATS",
|
|
18
|
+
ON_REMOTE_AUDIO_STATS = "ON_REMOTE_AUDIO_STATS",
|
|
19
|
+
ON_REMOTE_VIDEO_STATS = "ON_REMOTE_VIDEO_STATS"
|
|
15
20
|
}
|
|
@@ -51,5 +51,11 @@ export * from './classes/HMSHLSMeetingURLVariant';
|
|
|
51
51
|
export * from './classes/HMSHLSVariant';
|
|
52
52
|
export * from './classes/HMSHLSStreamingState';
|
|
53
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';
|
|
54
60
|
import { HMSSDK as HmsManager } from './classes/HMSSDK';
|
|
55
61
|
export default HmsManager;
|
package/package.json
CHANGED
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,13 @@ 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 { HMSBrowserRecordingState, HMSHLSStreamingState, HMSHLSVariant, HMSRtmpStreamingState, HMSServerRecordingState } from '..';
|
|
18
25
|
|
|
19
26
|
export class HMSEncoder {
|
|
20
27
|
static encodeHmsRoom(room: HMSRoom, id: string) {
|
|
@@ -22,11 +29,12 @@ export class HMSEncoder {
|
|
|
22
29
|
id: room?.id,
|
|
23
30
|
metaData: room?.metaData,
|
|
24
31
|
name: room?.name,
|
|
32
|
+
peerCount: room?.peerCount,
|
|
25
33
|
peers: HMSEncoder.encodeHmsPeers(room?.peers, id),
|
|
26
|
-
browserRecordingState: room?.browserRecordingState,
|
|
27
|
-
rtmpHMSRtmpStreamingState: room?.rtmpHMSRtmpStreamingState,
|
|
28
|
-
serverRecordingState: room?.serverRecordingState,
|
|
29
|
-
hlsStreamingState: room?.hlsStreamingState,
|
|
34
|
+
browserRecordingState: HMSEncoder.encodeBrowserRecordingState(room?.browserRecordingState),
|
|
35
|
+
rtmpHMSRtmpStreamingState: HMSEncoder.encodeRTMPStreamingState(room?.rtmpHMSRtmpStreamingState),
|
|
36
|
+
serverRecordingState: HMSEncoder.encodeServerRecordingState(room?.serverRecordingState),
|
|
37
|
+
hlsStreamingState: HMSEncoder.encodeHLSStreamingState(room?.hlsStreamingState),
|
|
30
38
|
};
|
|
31
39
|
|
|
32
40
|
return new HMSRoom(encodedObj);
|
|
@@ -183,6 +191,34 @@ export class HMSEncoder {
|
|
|
183
191
|
return new HMSVideoResolution(encodedObj);
|
|
184
192
|
}
|
|
185
193
|
|
|
194
|
+
static encodeHmsLocalAudioTrack(track: any, id: string) {
|
|
195
|
+
const encodedObj = {
|
|
196
|
+
id: id,
|
|
197
|
+
trackId: track?.trackId,
|
|
198
|
+
source: track?.source,
|
|
199
|
+
trackDescription: track?.trackDescription,
|
|
200
|
+
isMute: track?.isMute,
|
|
201
|
+
settings: HMSEncoder.encodeHmsAudioTrackSettings(track?.settings),
|
|
202
|
+
type: track?.type,
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
return new HMSLocalAudioTrack(encodedObj);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
static encodeHmsLocalVideoTrack(track: any, id: string) {
|
|
209
|
+
const encodedObj = {
|
|
210
|
+
id: id,
|
|
211
|
+
trackId: track?.trackId,
|
|
212
|
+
source: track?.source,
|
|
213
|
+
trackDescription: track?.trackDescription,
|
|
214
|
+
isMute: track?.isMute,
|
|
215
|
+
settings: HMSEncoder.encodeHmsVideoTrackSettings(track?.settings),
|
|
216
|
+
type: track?.type,
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
return new HMSLocalVideoTrack(encodedObj);
|
|
220
|
+
}
|
|
221
|
+
|
|
186
222
|
static encodeHmsRemotePeers(peers: any, id: string) {
|
|
187
223
|
const hmsPeers: any[] = [];
|
|
188
224
|
|
|
@@ -232,6 +268,33 @@ export class HMSEncoder {
|
|
|
232
268
|
return new HMSRemotePeer(encodedObj);
|
|
233
269
|
}
|
|
234
270
|
|
|
271
|
+
static encodeHmsRemoteAudioTrack(track: any, id: string) {
|
|
272
|
+
const encodedObj = {
|
|
273
|
+
id: id,
|
|
274
|
+
trackId: track?.trackId,
|
|
275
|
+
source: track?.source,
|
|
276
|
+
trackDescription: track?.trackDescription,
|
|
277
|
+
isMute: track?.isMute,
|
|
278
|
+
playbackAllowed: track?.playbackAllowed,
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
return new HMSRemoteAudioTrack(encodedObj);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
static encodeHmsRemoteVideoTrack(track: any, id: string) {
|
|
285
|
+
const encodedObj = {
|
|
286
|
+
id: id,
|
|
287
|
+
trackId: track?.trackId,
|
|
288
|
+
source: track?.source,
|
|
289
|
+
trackDescription: track?.trackDescription,
|
|
290
|
+
layer: track?.layer,
|
|
291
|
+
isMute: track?.isMute,
|
|
292
|
+
playbackAllowed: track?.playbackAllowed,
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
return new HMSRemoteVideoTrack(encodedObj);
|
|
296
|
+
}
|
|
297
|
+
|
|
235
298
|
static encodeHmsPreviewTracks(previewTracks: any) {
|
|
236
299
|
const encodedObj = {
|
|
237
300
|
audioTrack: previewTracks.audioTrack
|
|
@@ -282,4 +345,99 @@ export class HMSEncoder {
|
|
|
282
345
|
|
|
283
346
|
return new HMSChangeTrackStateRequest(encodedChangeTrackStateRequest);
|
|
284
347
|
}
|
|
348
|
+
|
|
349
|
+
static encodeRTCStats(data: any) {
|
|
350
|
+
let video = this.encodeRTCStatsUnit(data?.video);
|
|
351
|
+
let audio = this.encodeRTCStatsUnit(data?.audio);
|
|
352
|
+
let combined = this.encodeRTCStatsUnit(data?.combined);
|
|
353
|
+
|
|
354
|
+
return new HMSRTCStatsReport({ video, audio, combined });
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
static encodeRTCStatsUnit(data: any) {
|
|
358
|
+
return new HMSRTCStats({
|
|
359
|
+
bitrateReceived: data?.bitrateReceived,
|
|
360
|
+
bitrateSent: data?.bitrateSent,
|
|
361
|
+
bytesReceived: data?.bytesReceived,
|
|
362
|
+
bytesSent: data?.bytesSent,
|
|
363
|
+
packetsLost: data?.packetsLost,
|
|
364
|
+
packetsReceived: data?.packetsReceived,
|
|
365
|
+
roundTripTime: data?.roundTripTime,
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
static encodeHmsSpeakerUpdate(data: any, id: string) {
|
|
370
|
+
return new HMSSpeakerUpdate({
|
|
371
|
+
event: data?.event,
|
|
372
|
+
count: data?.count,
|
|
373
|
+
peers: HMSEncoder.encodeHmsSpeakers(data?.peers, id),
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
static encodeHmsSpeakers(data: any, id: string) {
|
|
378
|
+
let encodedSpeakers: Array<HMSSpeaker> = [];
|
|
379
|
+
|
|
380
|
+
data?.map((item: any) => {
|
|
381
|
+
encodedSpeakers.push(HMSEncoder.encodeHmsSpeaker(item, id));
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
return encodedSpeakers;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
static encodeHmsSpeaker(data: any, id: string) {
|
|
388
|
+
return new HMSSpeaker({
|
|
389
|
+
level: data?.level,
|
|
390
|
+
peer: HMSEncoder.encodeHmsPeer(data?.peer, id),
|
|
391
|
+
track: HMSEncoder.encodeHmsTrack(data?.track, id),
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
static encodeBrowserRecordingState(data: any) {
|
|
396
|
+
return new HMSBrowserRecordingState({
|
|
397
|
+
running: data?.running,
|
|
398
|
+
startedAt: new Date(parseInt(data?.startedAt)),
|
|
399
|
+
stoppedAt: new Date(parseInt(data?.stoppedAt)),
|
|
400
|
+
error: data?.error,
|
|
401
|
+
})
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
static encodeServerRecordingState(data: any) {
|
|
405
|
+
return new HMSServerRecordingState({
|
|
406
|
+
running: data?.running,
|
|
407
|
+
error: data?.error,
|
|
408
|
+
startedAt: new Date(parseInt(data?.startedAt))
|
|
409
|
+
})
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
static encodeRTMPStreamingState(data: any) {
|
|
413
|
+
return new HMSRtmpStreamingState({
|
|
414
|
+
running: data?.running,
|
|
415
|
+
startedAt: new Date(parseInt(data?.startedAt)),
|
|
416
|
+
stoppedAt: new Date(parseInt(data?.stoppedAt)),
|
|
417
|
+
error: data?.error
|
|
418
|
+
})
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
static encodeHLSStreamingState(data: any) {
|
|
422
|
+
return new HMSHLSStreamingState({
|
|
423
|
+
running: data?.running,
|
|
424
|
+
variants: this.encodeHLSVariants(data?.variants)
|
|
425
|
+
})
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
static encodeHLSVariants(data: any) {
|
|
429
|
+
let variants: HMSHLSVariant[] = []
|
|
430
|
+
|
|
431
|
+
data?.map((item: any) => {
|
|
432
|
+
let variant = new HMSHLSVariant({
|
|
433
|
+
hlsStreamUrl: item.hlsStreamUrl,
|
|
434
|
+
meetingUrl: item.meetingUrl,
|
|
435
|
+
metadata: item?.metadata,
|
|
436
|
+
startedAt: new Date(parseInt(item?.startedAt))
|
|
437
|
+
})
|
|
438
|
+
variants.push(variant);
|
|
439
|
+
})
|
|
440
|
+
|
|
441
|
+
return variants;
|
|
442
|
+
}
|
|
285
443
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export class HMSHLSVariant {
|
|
2
|
-
hlsStreamUrl
|
|
3
|
-
meetingUrl
|
|
4
|
-
metadata
|
|
5
|
-
startedAt
|
|
2
|
+
hlsStreamUrl?: string;
|
|
3
|
+
meetingUrl?: string;
|
|
4
|
+
metadata?: string;
|
|
5
|
+
startedAt?: Date;
|
|
6
6
|
|
|
7
7
|
constructor(params: {
|
|
8
|
-
hlsStreamUrl
|
|
9
|
-
meetingUrl
|
|
10
|
-
metadata
|
|
11
|
-
startedAt
|
|
8
|
+
hlsStreamUrl?: string;
|
|
9
|
+
meetingUrl?: string;
|
|
10
|
+
metadata?: string;
|
|
11
|
+
startedAt?: Date;
|
|
12
12
|
}) {
|
|
13
13
|
this.hlsStreamUrl = params.hlsStreamUrl;
|
|
14
14
|
this.meetingUrl = params.meetingUrl;
|
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
package/src/classes/HMSRoom.ts
CHANGED
|
@@ -13,6 +13,7 @@ export class HMSRoom {
|
|
|
13
13
|
rtmpHMSRtmpStreamingState: HMSRtmpStreamingState;
|
|
14
14
|
serverRecordingState: HMSServerRecordingState;
|
|
15
15
|
hlsStreamingState: HMSHLSStreamingState;
|
|
16
|
+
peerCount: number;
|
|
16
17
|
|
|
17
18
|
constructor(params: {
|
|
18
19
|
id: string;
|
|
@@ -23,6 +24,7 @@ export class HMSRoom {
|
|
|
23
24
|
rtmpHMSRtmpStreamingState: HMSRtmpStreamingState;
|
|
24
25
|
serverRecordingState: HMSServerRecordingState;
|
|
25
26
|
hlsStreamingState: HMSHLSStreamingState;
|
|
27
|
+
peerCount: number;
|
|
26
28
|
}) {
|
|
27
29
|
this.id = params.id;
|
|
28
30
|
this.name = params.name;
|
|
@@ -32,5 +34,6 @@ export class HMSRoom {
|
|
|
32
34
|
this.rtmpHMSRtmpStreamingState = params.rtmpHMSRtmpStreamingState;
|
|
33
35
|
this.serverRecordingState = params.serverRecordingState;
|
|
34
36
|
this.hlsStreamingState = params.hlsStreamingState;
|
|
37
|
+
this.peerCount = params.peerCount;
|
|
35
38
|
}
|
|
36
39
|
}
|
|
@@ -3,9 +3,18 @@ import type { HMSException } from './HMSException';
|
|
|
3
3
|
export class HMSRtmpStreamingState {
|
|
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
|
}
|