@100mslive/react-native-hms 0.8.3 → 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.
Files changed (186) hide show
  1. package/README.md +16 -8
  2. package/android/.gradle/6.9/executionHistory/executionHistory.lock +0 -0
  3. package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
  4. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  5. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  6. package/android/.gradle/checksums/checksums.lock +0 -0
  7. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  8. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  9. package/android/.idea/gradle.xml +13 -0
  10. package/android/.idea/misc.xml +9 -0
  11. package/android/.idea/modules/android.iml +18 -0
  12. package/android/.idea/modules.xml +8 -0
  13. package/android/.idea/sonarlint/issuestore/f/0/f07866736216be0ee2aba49e392191aeae700a35 +0 -0
  14. package/android/.idea/sonarlint/issuestore/index.pb +3 -0
  15. package/android/.idea/vcs.xml +6 -0
  16. package/android/build.gradle +4 -2
  17. package/android/local.properties +8 -0
  18. package/android/src/main/java/com/reactnativehmssdk/HmsDecoder.kt +58 -5
  19. package/android/src/main/java/com/reactnativehmssdk/HmsHelper.kt +76 -61
  20. package/android/src/main/java/com/reactnativehmssdk/HmsModule.kt +99 -8
  21. package/android/src/main/java/com/reactnativehmssdk/HmsSDK.kt +299 -128
  22. package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +66 -0
  23. package/android/src/main/java/com/reactnativehmssdk/HmsView.kt +28 -3
  24. package/android/src/main/java/com/reactnativehmssdk/HmssdkViewManager.kt +10 -1
  25. package/android/src/main/res/layout/hms_view.xml +19 -0
  26. package/ios/HmsDecoder.swift +217 -123
  27. package/ios/HmsHelper.swift +56 -38
  28. package/ios/HmsManager.m +11 -3
  29. package/ios/HmsManager.swift +125 -68
  30. package/ios/HmsSDK.swift +407 -189
  31. package/ios/HmsView.swift +50 -68
  32. package/ios/VideoCollectionViewCell.swift +4 -4
  33. package/lib/commonjs/classes/HMSBrowserRecordingState.js +6 -0
  34. package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -1
  35. package/lib/commonjs/classes/HMSChangeTrackStateRequest.js +3 -0
  36. package/lib/commonjs/classes/HMSChangeTrackStateRequest.js.map +1 -1
  37. package/lib/commonjs/classes/HMSEncoder.js +166 -4
  38. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  39. package/lib/commonjs/classes/HMSHLSConfig.js +20 -0
  40. package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -0
  41. package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js +23 -0
  42. package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js.map +1 -0
  43. package/lib/commonjs/classes/HMSHLSStreamingState.js +23 -0
  44. package/lib/commonjs/classes/HMSHLSStreamingState.js.map +1 -0
  45. package/lib/commonjs/classes/HMSHLSVariant.js +29 -0
  46. package/lib/commonjs/classes/HMSHLSVariant.js.map +1 -0
  47. package/lib/commonjs/classes/HMSLocalAudioStats.js +26 -0
  48. package/lib/commonjs/classes/HMSLocalAudioStats.js.map +1 -0
  49. package/lib/commonjs/classes/HMSLocalVideoStats.js +32 -0
  50. package/lib/commonjs/classes/HMSLocalVideoStats.js.map +1 -0
  51. package/lib/commonjs/classes/HMSLogger.js +27 -0
  52. package/lib/commonjs/classes/HMSLogger.js.map +1 -1
  53. package/lib/commonjs/classes/HMSPeerUpdate.js +2 -0
  54. package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
  55. package/lib/commonjs/classes/HMSPermissions.js +2 -2
  56. package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
  57. package/lib/commonjs/classes/HMSRTCStats.js +38 -0
  58. package/lib/commonjs/classes/HMSRTCStats.js.map +1 -0
  59. package/lib/commonjs/classes/HMSRTCStatsReport.js +26 -0
  60. package/lib/commonjs/classes/HMSRTCStatsReport.js.map +1 -0
  61. package/lib/commonjs/classes/HMSRemoteAudioStats.js +32 -0
  62. package/lib/commonjs/classes/HMSRemoteAudioStats.js.map +1 -0
  63. package/lib/commonjs/classes/HMSRemoteVideoStats.js +38 -0
  64. package/lib/commonjs/classes/HMSRemoteVideoStats.js.map +1 -0
  65. package/lib/commonjs/classes/HMSRoom.js +6 -0
  66. package/lib/commonjs/classes/HMSRoom.js.map +1 -1
  67. package/lib/commonjs/classes/HMSRoomUpdate.js +7 -0
  68. package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
  69. package/lib/commonjs/classes/HMSRtmpStreamingState.js +6 -0
  70. package/lib/commonjs/classes/HMSRtmpStreamingState.js.map +1 -1
  71. package/lib/commonjs/classes/HMSSDK.js +476 -115
  72. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  73. package/lib/commonjs/classes/HMSServerRecordingState.js +3 -0
  74. package/lib/commonjs/classes/HMSServerRecordingState.js.map +1 -1
  75. package/lib/commonjs/classes/HMSUpdateListenerActions.js +5 -0
  76. package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
  77. package/lib/commonjs/classes/HmsView.js +26 -4
  78. package/lib/commonjs/classes/HmsView.js.map +1 -1
  79. package/lib/commonjs/index.js +140 -0
  80. package/lib/commonjs/index.js.map +1 -1
  81. package/lib/module/classes/HMSBrowserRecordingState.js +6 -0
  82. package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -1
  83. package/lib/module/classes/HMSChangeTrackStateRequest.js +3 -0
  84. package/lib/module/classes/HMSChangeTrackStateRequest.js.map +1 -1
  85. package/lib/module/classes/HMSEncoder.js +159 -4
  86. package/lib/module/classes/HMSEncoder.js.map +1 -1
  87. package/lib/module/classes/HMSHLSConfig.js +11 -0
  88. package/lib/module/classes/HMSHLSConfig.js.map +1 -0
  89. package/lib/module/classes/HMSHLSMeetingURLVariant.js +14 -0
  90. package/lib/module/classes/HMSHLSMeetingURLVariant.js.map +1 -0
  91. package/lib/module/classes/HMSHLSStreamingState.js +14 -0
  92. package/lib/module/classes/HMSHLSStreamingState.js.map +1 -0
  93. package/lib/module/classes/HMSHLSVariant.js +20 -0
  94. package/lib/module/classes/HMSHLSVariant.js.map +1 -0
  95. package/lib/module/classes/HMSLocalAudioStats.js +17 -0
  96. package/lib/module/classes/HMSLocalAudioStats.js.map +1 -0
  97. package/lib/module/classes/HMSLocalVideoStats.js +23 -0
  98. package/lib/module/classes/HMSLocalVideoStats.js.map +1 -0
  99. package/lib/module/classes/HMSLogger.js +27 -0
  100. package/lib/module/classes/HMSLogger.js.map +1 -1
  101. package/lib/module/classes/HMSPeerUpdate.js +2 -0
  102. package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
  103. package/lib/module/classes/HMSPermissions.js +2 -2
  104. package/lib/module/classes/HMSPermissions.js.map +1 -1
  105. package/lib/module/classes/HMSRTCStats.js +29 -0
  106. package/lib/module/classes/HMSRTCStats.js.map +1 -0
  107. package/lib/module/classes/HMSRTCStatsReport.js +17 -0
  108. package/lib/module/classes/HMSRTCStatsReport.js.map +1 -0
  109. package/lib/module/classes/HMSRemoteAudioStats.js +23 -0
  110. package/lib/module/classes/HMSRemoteAudioStats.js.map +1 -0
  111. package/lib/module/classes/HMSRemoteVideoStats.js +29 -0
  112. package/lib/module/classes/HMSRemoteVideoStats.js.map +1 -0
  113. package/lib/module/classes/HMSRoom.js +6 -0
  114. package/lib/module/classes/HMSRoom.js.map +1 -1
  115. package/lib/module/classes/HMSRoomUpdate.js +7 -0
  116. package/lib/module/classes/HMSRoomUpdate.js.map +1 -1
  117. package/lib/module/classes/HMSRtmpStreamingState.js +6 -0
  118. package/lib/module/classes/HMSRtmpStreamingState.js.map +1 -1
  119. package/lib/module/classes/HMSSDK.js +464 -116
  120. package/lib/module/classes/HMSSDK.js.map +1 -1
  121. package/lib/module/classes/HMSServerRecordingState.js +3 -0
  122. package/lib/module/classes/HMSServerRecordingState.js.map +1 -1
  123. package/lib/module/classes/HMSUpdateListenerActions.js +5 -0
  124. package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
  125. package/lib/module/classes/HmsView.js +23 -4
  126. package/lib/module/classes/HmsView.js.map +1 -1
  127. package/lib/module/index.js +10 -0
  128. package/lib/module/index.js.map +1 -1
  129. package/lib/typescript/classes/HMSBrowserRecordingState.d.ts +4 -0
  130. package/lib/typescript/classes/HMSChangeTrackStateRequest.d.ts +2 -0
  131. package/lib/typescript/classes/HMSEncoder.d.ts +21 -0
  132. package/lib/typescript/classes/HMSHLSConfig.d.ts +7 -0
  133. package/lib/typescript/classes/HMSHLSMeetingURLVariant.d.ts +8 -0
  134. package/lib/typescript/classes/HMSHLSStreamingState.d.ts +9 -0
  135. package/lib/typescript/classes/HMSHLSVariant.d.ts +12 -0
  136. package/lib/typescript/classes/HMSLocalAudioStats.d.ts +10 -0
  137. package/lib/typescript/classes/HMSLocalVideoStats.d.ts +15 -0
  138. package/lib/typescript/classes/HMSLogger.d.ts +2 -0
  139. package/lib/typescript/classes/HMSPeerUpdate.d.ts +3 -1
  140. package/lib/typescript/classes/HMSPermissions.d.ts +2 -2
  141. package/lib/typescript/classes/HMSRTCStats.d.ts +18 -0
  142. package/lib/typescript/classes/HMSRTCStatsReport.d.ts +11 -0
  143. package/lib/typescript/classes/HMSRemoteAudioStats.d.ts +14 -0
  144. package/lib/typescript/classes/HMSRemoteVideoStats.d.ts +19 -0
  145. package/lib/typescript/classes/HMSRoom.d.ts +5 -0
  146. package/lib/typescript/classes/HMSRoomUpdate.d.ts +8 -1
  147. package/lib/typescript/classes/HMSRtmpStreamingState.d.ts +4 -0
  148. package/lib/typescript/classes/HMSSDK.d.ts +33 -9
  149. package/lib/typescript/classes/HMSServerRecordingState.d.ts +2 -0
  150. package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +6 -1
  151. package/lib/typescript/index.d.ts +10 -0
  152. package/package.json +1 -1
  153. package/react-native-hms.podspec +1 -1
  154. package/src/classes/HMSBrowserRecordingState.ts +10 -1
  155. package/src/classes/HMSChangeTrackStateRequest.ts +7 -1
  156. package/src/classes/HMSEncoder.ts +163 -3
  157. package/src/classes/HMSHLSConfig.ts +9 -0
  158. package/src/classes/HMSHLSMeetingURLVariant.ts +9 -0
  159. package/src/classes/HMSHLSStreamingState.ts +11 -0
  160. package/src/classes/HMSHLSVariant.ts +18 -0
  161. package/src/classes/HMSLocalAudioStats.ts +15 -0
  162. package/src/classes/HMSLocalVideoStats.ts +23 -0
  163. package/src/classes/HMSLogger.ts +14 -0
  164. package/src/classes/HMSPeerUpdate.ts +2 -0
  165. package/src/classes/HMSPermissions.ts +3 -3
  166. package/src/classes/HMSRTCStats.ts +27 -0
  167. package/src/classes/HMSRTCStatsReport.ts +17 -0
  168. package/src/classes/HMSRemoteAudioStats.ts +21 -0
  169. package/src/classes/HMSRemoteVideoStats.ts +29 -0
  170. package/src/classes/HMSRoom.ts +7 -0
  171. package/src/classes/HMSRoomUpdate.ts +7 -0
  172. package/src/classes/HMSRtmpStreamingState.ts +10 -1
  173. package/src/classes/HMSSDK.tsx +325 -26
  174. package/src/classes/HMSServerRecordingState.ts +7 -1
  175. package/src/classes/HMSUpdateListenerActions.ts +5 -0
  176. package/src/classes/HmsView.tsx +32 -4
  177. package/src/index.ts +10 -0
  178. package/android/.gradle/6.9/executionHistory/executionHistory.bin +0 -0
  179. package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
  180. package/android/.gradle/6.9/fileHashes/resourceHashesCache.bin +0 -0
  181. package/android/.gradle/6.9/javaCompile/classAnalysis.bin +0 -0
  182. package/android/.gradle/6.9/javaCompile/jarAnalysis.bin +0 -0
  183. package/android/.gradle/6.9/javaCompile/javaCompile.lock +0 -0
  184. package/android/.gradle/6.9/javaCompile/taskHistory.bin +0 -0
  185. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  186. package/android/.project +0 -34
@@ -0,0 +1,18 @@
1
+ export declare class HMSRTCStats {
2
+ bitrateReceived?: number;
3
+ bitrateSent?: number;
4
+ bytesReceived?: number;
5
+ bytesSent?: number;
6
+ packetsLost?: number;
7
+ packetsReceived?: number;
8
+ roundTripTime?: number;
9
+ constructor(params: {
10
+ bitrateReceived?: number;
11
+ bitrateSent?: number;
12
+ bytesReceived?: number;
13
+ bytesSent?: number;
14
+ packetsLost?: number;
15
+ packetsReceived?: number;
16
+ roundTripTime?: number;
17
+ });
18
+ }
@@ -0,0 +1,11 @@
1
+ import type { HMSRTCStats } from './HMSRTCStats';
2
+ export declare class HMSRTCStatsReport {
3
+ video?: HMSRTCStats;
4
+ audio?: HMSRTCStats;
5
+ combined?: HMSRTCStats;
6
+ constructor(params: {
7
+ video?: HMSRTCStats;
8
+ audio?: HMSRTCStats;
9
+ combined?: HMSRTCStats;
10
+ });
11
+ }
@@ -0,0 +1,14 @@
1
+ export declare class HMSRemoteAudioStats {
2
+ bitrate?: number;
3
+ packetsReceived?: number;
4
+ packetsLost?: number;
5
+ bytesReceived?: number;
6
+ jitter?: number;
7
+ constructor(params: {
8
+ bitrate?: number;
9
+ packetsReceived?: number;
10
+ packetsLost?: number;
11
+ bytesReceived?: number;
12
+ jitter?: number;
13
+ });
14
+ }
@@ -0,0 +1,19 @@
1
+ import type { HMSVideoResolution } from './HMSVideoResolution';
2
+ export declare class HMSRemoteVideoStats {
3
+ bitrate?: number;
4
+ packetsReceived?: number;
5
+ packetsLost?: number;
6
+ bytesReceived?: number;
7
+ jitter?: number;
8
+ resolution?: HMSVideoResolution;
9
+ frameRate?: number;
10
+ constructor(params: {
11
+ bitrate?: number;
12
+ packetsReceived?: number;
13
+ packetsLost?: number;
14
+ bytesReceived?: number;
15
+ jitter?: number;
16
+ resolution?: HMSVideoResolution;
17
+ frameRate?: number;
18
+ });
19
+ }
@@ -2,6 +2,7 @@ import type { HMSPeer } from './HMSPeer';
2
2
  import type { HMSRtmpStreamingState } from './HMSRtmpStreamingState';
3
3
  import type { HMSServerRecordingState } from './HMSServerRecordingState';
4
4
  import type { HMSBrowserRecordingState } from './HMSBrowserRecordingState';
5
+ import type { HMSHLSStreamingState } from './HMSHLSStreamingState';
5
6
  export declare class HMSRoom {
6
7
  id: string;
7
8
  name: string;
@@ -10,6 +11,8 @@ export declare class HMSRoom {
10
11
  browserRecordingState: HMSBrowserRecordingState;
11
12
  rtmpHMSRtmpStreamingState: HMSRtmpStreamingState;
12
13
  serverRecordingState: HMSServerRecordingState;
14
+ hlsStreamingState: HMSHLSStreamingState;
15
+ peerCount: number;
13
16
  constructor(params: {
14
17
  id: string;
15
18
  name: string;
@@ -18,5 +21,7 @@ export declare class HMSRoom {
18
21
  browserRecordingState: HMSBrowserRecordingState;
19
22
  rtmpHMSRtmpStreamingState: HMSRtmpStreamingState;
20
23
  serverRecordingState: HMSServerRecordingState;
24
+ hlsStreamingState: HMSHLSStreamingState;
25
+ peerCount: number;
21
26
  });
22
27
  }
@@ -1,4 +1,11 @@
1
1
  export declare enum HMSRoomUpdate {
2
2
  ROOM_MUTED = "ROOM_MUTED",
3
- ROOM_UNMUTED = "ROOM_UNMUTED"
3
+ ROOM_UNMUTED = "ROOM_UNMUTED",
4
+ ROOM_TYPE_CHANGED = "ROOM_TYPE_CHANGED",
5
+ META_DATA_CHANGED = "META_DATA_CHANGED",
6
+ SERVER_RECORDING_STATE_UPDATED = "SERVER_RECORDING_STATE_UPDATED",
7
+ RTMP_STREAMING_STATE_UPDATED = "RTMP_STREAMING_STATE_UPDATED",
8
+ BROWSER_RECORDING_STATE_UPDATED = "BROWSER_RECORDING_STATE_UPDATED",
9
+ HLS_STREAMING_STATE_UPDATED = "HLS_STREAMING_STATE_UPDATED",
10
+ ROOM_ID_UPDATED = "ROOM_ID_UPDATED"
4
11
  }
@@ -2,8 +2,12 @@ import type { HMSException } from './HMSException';
2
2
  export declare class HMSRtmpStreamingState {
3
3
  running: string;
4
4
  error: HMSException;
5
+ startedAt: Date;
6
+ stoppedAt: Date;
5
7
  constructor(params: {
6
8
  running: string;
7
9
  error: HMSException;
10
+ startedAt: Date;
11
+ stoppedAt: Date;
8
12
  });
9
13
  }
@@ -13,6 +13,7 @@ import type { HMSPeer } from './HMSPeer';
13
13
  import { HMSVideoViewMode } from './HMSVideoViewMode';
14
14
  import type { HMSTrackSettings } from './HMSTrackSettings';
15
15
  import type { HMSRTMPConfig } from './HMSRTMPConfig';
16
+ import type { HMSHLSConfig } from './HMSHLSConfig';
16
17
  interface HmsComponentProps {
17
18
  trackId: string;
18
19
  sink: boolean;
@@ -28,6 +29,7 @@ export declare class HMSSDK {
28
29
  knownRoles?: HMSRole[];
29
30
  id: string;
30
31
  private muteStatus;
32
+ appStateSubscription?: any;
31
33
  onPreviewDelegate?: any;
32
34
  onJoinDelegate?: any;
33
35
  onRoomDelegate?: any;
@@ -41,6 +43,11 @@ export declare class HMSSDK {
41
43
  onRoleChangeRequestDelegate?: any;
42
44
  onChangeTrackStateRequestDelegate?: any;
43
45
  onRemovedFromRoomDelegate?: any;
46
+ onRtcStatsDelegate?: any;
47
+ onLocalAudioStatsDelegate?: any;
48
+ onLocalVideoStatsDelegate?: any;
49
+ onRemoteAudioStatsDelegate?: any;
50
+ onRemoteVideoStatsDelegate?: any;
44
51
  constructor(id: string);
45
52
  /**
46
53
  * - Returns an instance of [HMSSDK]{@link HMSSDK}
@@ -51,7 +58,7 @@ export declare class HMSSDK {
51
58
  * @memberof HMSSDK
52
59
  */
53
60
  static build(params?: {
54
- trackSettings?: HMSTrackSettings;
61
+ trackSettings: HMSTrackSettings;
55
62
  }): Promise<HMSSDK>;
56
63
  static getLogger(): HMSLogger | undefined;
57
64
  setLogger: (hmsLogger: HMSLogger) => void;
@@ -68,6 +75,7 @@ export declare class HMSSDK {
68
75
  */
69
76
  join: (config: HMSConfig) => Promise<void>;
70
77
  preview: (config: HMSConfig) => void;
78
+ previewForRole: (role: HMSRole) => Promise<any>;
71
79
  HmsView: ({ sink, trackId, style, mirror, scaleType, }: HmsComponentProps) => JSX.Element;
72
80
  /**
73
81
  * Calls leave function of native sdk and session of current user is invalidated
@@ -75,21 +83,32 @@ export declare class HMSSDK {
75
83
  * @memberof HMSSDK
76
84
  */
77
85
  leave: () => Promise<any>;
78
- sendBroadcastMessage: (message: string, type?: string | undefined) => Promise<any>;
79
- sendGroupMessage: (message: string, roles: HMSRole[], type?: string | undefined) => Promise<any>;
80
- sendDirectMessage: (message: string, peerId: string, type?: string | undefined) => Promise<any>;
86
+ sendBroadcastMessage: (message: string, type?: string) => Promise<any>;
87
+ sendGroupMessage: (message: string, roles: HMSRole[], type?: string) => Promise<any>;
88
+ sendDirectMessage: (message: string, peer: HMSPeer, type?: string) => Promise<any>;
81
89
  changeMetadata: (metadata: string) => void;
82
90
  startRTMPOrRecording: (data: HMSRTMPConfig) => Promise<any>;
83
91
  stopRtmpAndRecording: () => Promise<any>;
92
+ startHLSStreaming: (data: HMSHLSConfig) => Promise<any>;
93
+ stopHLSStreaming: () => Promise<any>;
84
94
  changeRole: (peer: HMSPeer, role: HMSRole, force?: boolean) => Promise<any>;
85
95
  changeTrackState: (track: HMSTrack, mute: boolean) => Promise<any>;
86
- changeTrackStateRoles: (type: HMSTrackType, mute: boolean, source: string, roles: Array<HMSRole>) => Promise<any>;
87
- removePeer: (peerId: string, reason: string) => Promise<any>;
88
- endRoom: (lock: boolean, reason: string) => Promise<any>;
89
- acceptRoleChange: () => void;
90
- muteAllPeersAudio: (mute: boolean) => void;
96
+ changeTrackStateForRoles: (mute: boolean, type?: HMSTrackType | undefined, source?: string | undefined, roles?: HMSRole[] | undefined) => Promise<any>;
97
+ removePeer: (peer: HMSPeer, reason: string) => Promise<any>;
98
+ endRoom: (reason: string, lock?: boolean) => Promise<any>;
99
+ changeName: (name: string) => Promise<any>;
100
+ acceptRoleChange: () => Promise<any>;
101
+ setPlaybackForAllAudio: (mute: boolean) => void;
102
+ remoteMuteAllAudio: () => void;
91
103
  getRoom: () => Promise<HMSRoom>;
92
104
  setVolume: (track: HMSTrack, volume: number) => void;
105
+ resetVolume: () => void;
106
+ addAppStateListener: () => void;
107
+ startScreenshare: () => void;
108
+ isScreenShared: () => Promise<any>;
109
+ stopScreenshare: () => Promise<any>;
110
+ enableRTCStats: () => void;
111
+ disableRTCStats: () => void;
93
112
  /**
94
113
  * - This is a prototype event listener that takes action and listens for updates related to that particular action
95
114
  * - This method will be @deprecated in future and event listener will be passed in join method
@@ -127,5 +146,10 @@ export declare class HMSSDK {
127
146
  onRemovedFromRoomListener: (data: any) => void;
128
147
  reconnectingListener: (data: any) => void;
129
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;
130
154
  }
131
155
  export {};
@@ -2,8 +2,10 @@ import type { HMSException } from './HMSException';
2
2
  export declare class HMSServerRecordingState {
3
3
  running: string;
4
4
  error: HMSException;
5
+ startedAt: Date;
5
6
  constructor(params: {
6
7
  running: string;
7
8
  error: HMSException;
9
+ startedAt: Date;
8
10
  });
9
11
  }
@@ -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
  }
@@ -46,6 +46,16 @@ 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';
50
60
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
51
61
  export default HmsManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@100mslive/react-native-hms",
3
- "version": "0.8.3",
3
+ "version": "0.9.1",
4
4
  "description": "The React Native package for 100ms SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
16
16
  s.source_files = "ios/**/*.{h,m,mm,swift}"
17
17
 
18
18
  s.dependency "React-Core"
19
- s.dependency "HMSSDK"
19
+ s.dependency "HMSSDK", "0.2.7"
20
20
  end
@@ -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: { running: string; error: HMSException }) {
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
  }
@@ -3,9 +3,15 @@ import type { HMSPeer } from './HMSPeer';
3
3
  export class HMSChangeTrackStateRequest {
4
4
  requestedBy: HMSPeer;
5
5
  trackType: string;
6
+ mute: boolean;
6
7
 
7
- constructor(params: { requestedBy: HMSPeer; trackType: string }) {
8
+ constructor(params: {
9
+ requestedBy: HMSPeer;
10
+ trackType: string;
11
+ mute: boolean;
12
+ }) {
8
13
  this.requestedBy = params.requestedBy;
9
14
  this.trackType = params.trackType;
15
+ this.mute = params.mute;
10
16
  }
11
17
  }
@@ -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,10 +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,
34
+ browserRecordingState: HMSEncoder.encodeBrowserRecordingState(room?.browserRecordingState),
35
+ rtmpHMSRtmpStreamingState: HMSEncoder.encodeRTMPStreamingState(room?.rtmpHMSRtmpStreamingState),
36
+ serverRecordingState: HMSEncoder.encodeServerRecordingState(room?.serverRecordingState),
37
+ hlsStreamingState: HMSEncoder.encodeHLSStreamingState(room?.hlsStreamingState),
29
38
  };
30
39
 
31
40
  return new HMSRoom(encodedObj);
@@ -182,6 +191,34 @@ export class HMSEncoder {
182
191
  return new HMSVideoResolution(encodedObj);
183
192
  }
184
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
+
185
222
  static encodeHmsRemotePeers(peers: any, id: string) {
186
223
  const hmsPeers: any[] = [];
187
224
 
@@ -231,6 +268,33 @@ export class HMSEncoder {
231
268
  return new HMSRemotePeer(encodedObj);
232
269
  }
233
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
+
234
298
  static encodeHmsPreviewTracks(previewTracks: any) {
235
299
  const encodedObj = {
236
300
  audioTrack: previewTracks.audioTrack
@@ -276,8 +340,104 @@ export class HMSEncoder {
276
340
  const encodedChangeTrackStateRequest = {
277
341
  requestedBy: HMSEncoder.encodeHmsPeer(data.requestedBy, id),
278
342
  trackType: data.trackType,
343
+ mute: data.mute,
279
344
  };
280
345
 
281
346
  return new HMSChangeTrackStateRequest(encodedChangeTrackStateRequest);
282
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
+ }
283
443
  }
@@ -0,0 +1,9 @@
1
+ import type { HMSHLSMeetingURLVariant } from './HMSHLSMeetingURLVariant';
2
+
3
+ export class HMSHLSConfig {
4
+ meetingURLVariants?: Array<HMSHLSMeetingURLVariant>;
5
+
6
+ constructor(params: { meetingURLVariants?: Array<HMSHLSMeetingURLVariant> }) {
7
+ this.meetingURLVariants = params.meetingURLVariants;
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ export class HMSHLSMeetingURLVariant {
2
+ meetingUrl: string;
3
+ metadata: string;
4
+
5
+ constructor(params: { meetingUrl: string; metadata: string }) {
6
+ this.meetingUrl = params.meetingUrl;
7
+ this.metadata = params.metadata;
8
+ }
9
+ }
@@ -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
+ }
@@ -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,6 +23,9 @@ 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
+ }
25
29
  }
26
30
  this.logs.push({ type: 'verbose', message, data, id: data?.id });
27
31
  }
@@ -29,6 +33,9 @@ export class HMSLogger {
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
+ }
32
39
  }
33
40
  this.logs.push({ type: 'warn', message, data, id: data?.id });
34
41
  }
@@ -36,6 +43,9 @@ export class HMSLogger {
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
+ }
39
49
  }
40
50
  this.logs.push({ type: 'error', message, data, id: data?.id });
41
51
  }
@@ -44,6 +54,10 @@ export class HMSLogger {
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: {
@@ -10,4 +10,6 @@ export enum HMSPeerUpdate {
10
10
  STARTED_SPEAKING = 'STARTED_SPEAKING',
11
11
  STOPPED_SPEAKING = 'STOPPED_SPEAKING',
12
12
  ROLE_CHANGED = 'ROLE_CHANGED',
13
+ NAME_CHANGED = 'NAME_CHANGED',
14
+ DEFAULT_UPDATE = 'DEFAULT_UPDATE'
13
15
  }