@100mslive/react-native-hms 0.7.2 → 0.8.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 (196) hide show
  1. package/README.md +37 -39
  2. package/android/.gradle/checksums/checksums.lock +0 -0
  3. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  4. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  5. package/android/.project +34 -0
  6. package/android/build.gradle +1 -1
  7. package/android/src/main/java/com/reactnativehmssdk/HmsDecoder.kt +129 -29
  8. package/android/src/main/java/com/reactnativehmssdk/HmsHelper.kt +124 -2
  9. package/android/src/main/java/com/reactnativehmssdk/HmsModule.kt +138 -495
  10. package/android/src/main/java/com/reactnativehmssdk/HmsSDK.kt +899 -0
  11. package/android/src/main/java/com/reactnativehmssdk/HmsView.kt +26 -8
  12. package/android/src/main/java/com/reactnativehmssdk/HmssdkViewManager.kt +8 -6
  13. package/ios/HmsDecoder.swift +142 -20
  14. package/ios/HmsHelper.swift +110 -0
  15. package/ios/HmsManager.m +13 -7
  16. package/ios/HmsManager.swift +115 -375
  17. package/ios/HmsSDK.swift +716 -0
  18. package/ios/HmsView.swift +16 -8
  19. package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
  20. package/lib/commonjs/classes/HMSAudioTrackSettings.js +3 -0
  21. package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
  22. package/lib/commonjs/classes/HMSBrowserRecordingState.js +23 -0
  23. package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -0
  24. package/lib/commonjs/classes/HMSCameraFacing.js +14 -0
  25. package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -0
  26. package/lib/commonjs/classes/HMSConfig.js +3 -7
  27. package/lib/commonjs/classes/HMSConfig.js.map +1 -1
  28. package/lib/commonjs/classes/HMSEncoder.js +60 -32
  29. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  30. package/lib/commonjs/classes/HMSException.js +30 -0
  31. package/lib/commonjs/classes/HMSException.js.map +1 -0
  32. package/lib/commonjs/classes/HMSHelper.js +2 -2
  33. package/lib/commonjs/classes/HMSHelper.js.map +1 -1
  34. package/lib/commonjs/classes/HMSLocalAudioTrack.js +19 -1
  35. package/lib/commonjs/classes/HMSLocalAudioTrack.js.map +1 -1
  36. package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
  37. package/lib/commonjs/classes/HMSLocalVideoTrack.js +10 -2
  38. package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
  39. package/lib/commonjs/classes/HMSLogger.js.map +1 -1
  40. package/lib/commonjs/classes/HMSPeer.js +3 -0
  41. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  42. package/lib/commonjs/classes/HMSPeerUpdate.js +1 -0
  43. package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
  44. package/lib/commonjs/classes/HMSPermissions.js +7 -7
  45. package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
  46. package/lib/commonjs/classes/HMSRTMPConfig.js +26 -0
  47. package/lib/commonjs/classes/HMSRTMPConfig.js.map +1 -0
  48. package/lib/commonjs/classes/HMSRemoteAudioTrack.js +2 -0
  49. package/lib/commonjs/classes/HMSRemoteAudioTrack.js.map +1 -1
  50. package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
  51. package/lib/commonjs/classes/HMSRemoteVideoTrack.js +2 -0
  52. package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
  53. package/lib/commonjs/classes/HMSRoom.js +9 -0
  54. package/lib/commonjs/classes/HMSRoom.js.map +1 -1
  55. package/lib/commonjs/classes/HMSRtmpStreamingState.js +23 -0
  56. package/lib/commonjs/classes/HMSRtmpStreamingState.js.map +1 -0
  57. package/lib/commonjs/classes/HMSSDK.js +336 -109
  58. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  59. package/lib/commonjs/classes/HMSServerRecordingState.js +23 -0
  60. package/lib/commonjs/classes/HMSServerRecordingState.js.map +1 -0
  61. package/lib/commonjs/classes/HMSTrack.js +8 -18
  62. package/lib/commonjs/classes/HMSTrack.js.map +1 -1
  63. package/lib/commonjs/classes/HMSTrackType.js +14 -0
  64. package/lib/commonjs/classes/HMSTrackType.js.map +1 -0
  65. package/lib/commonjs/classes/HMSVideoResolution.js +23 -0
  66. package/lib/commonjs/classes/HMSVideoResolution.js.map +1 -0
  67. package/lib/commonjs/classes/HMSVideoSettings.js.map +1 -1
  68. package/lib/commonjs/classes/HMSVideoTrack.js +2 -0
  69. package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
  70. package/lib/commonjs/classes/HMSVideoTrackSettings.js +0 -3
  71. package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
  72. package/lib/commonjs/classes/HmsView.js +10 -7
  73. package/lib/commonjs/classes/HmsView.js.map +1 -1
  74. package/lib/commonjs/index.js +98 -0
  75. package/lib/commonjs/index.js.map +1 -1
  76. package/lib/module/classes/HMSAudioTrack.js.map +1 -1
  77. package/lib/module/classes/HMSAudioTrackSettings.js +3 -0
  78. package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
  79. package/lib/module/classes/HMSBrowserRecordingState.js +14 -0
  80. package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -0
  81. package/lib/module/classes/HMSCameraFacing.js +7 -0
  82. package/lib/module/classes/HMSCameraFacing.js.map +1 -0
  83. package/lib/module/classes/HMSConfig.js +3 -7
  84. package/lib/module/classes/HMSConfig.js.map +1 -1
  85. package/lib/module/classes/HMSEncoder.js +59 -32
  86. package/lib/module/classes/HMSEncoder.js.map +1 -1
  87. package/lib/module/classes/HMSException.js +21 -0
  88. package/lib/module/classes/HMSException.js.map +1 -0
  89. package/lib/module/classes/HMSHelper.js +2 -2
  90. package/lib/module/classes/HMSHelper.js.map +1 -1
  91. package/lib/module/classes/HMSLocalAudioTrack.js +20 -2
  92. package/lib/module/classes/HMSLocalAudioTrack.js.map +1 -1
  93. package/lib/module/classes/HMSLocalPeer.js.map +1 -1
  94. package/lib/module/classes/HMSLocalVideoTrack.js +10 -2
  95. package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
  96. package/lib/module/classes/HMSLogger.js.map +1 -1
  97. package/lib/module/classes/HMSPeer.js +3 -0
  98. package/lib/module/classes/HMSPeer.js.map +1 -1
  99. package/lib/module/classes/HMSPeerUpdate.js +1 -0
  100. package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
  101. package/lib/module/classes/HMSPermissions.js +7 -7
  102. package/lib/module/classes/HMSPermissions.js.map +1 -1
  103. package/lib/module/classes/HMSRTMPConfig.js +17 -0
  104. package/lib/module/classes/HMSRTMPConfig.js.map +1 -0
  105. package/lib/module/classes/HMSRemoteAudioTrack.js +2 -0
  106. package/lib/module/classes/HMSRemoteAudioTrack.js.map +1 -1
  107. package/lib/module/classes/HMSRemotePeer.js.map +1 -1
  108. package/lib/module/classes/HMSRemoteVideoTrack.js +2 -0
  109. package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
  110. package/lib/module/classes/HMSRoom.js +9 -0
  111. package/lib/module/classes/HMSRoom.js.map +1 -1
  112. package/lib/module/classes/HMSRtmpStreamingState.js +14 -0
  113. package/lib/module/classes/HMSRtmpStreamingState.js.map +1 -0
  114. package/lib/module/classes/HMSSDK.js +328 -109
  115. package/lib/module/classes/HMSSDK.js.map +1 -1
  116. package/lib/module/classes/HMSServerRecordingState.js +14 -0
  117. package/lib/module/classes/HMSServerRecordingState.js.map +1 -0
  118. package/lib/module/classes/HMSTrack.js +8 -16
  119. package/lib/module/classes/HMSTrack.js.map +1 -1
  120. package/lib/module/classes/HMSTrackType.js +7 -0
  121. package/lib/module/classes/HMSTrackType.js.map +1 -0
  122. package/lib/module/classes/HMSVideoResolution.js +14 -0
  123. package/lib/module/classes/HMSVideoResolution.js.map +1 -0
  124. package/lib/module/classes/HMSVideoSettings.js.map +1 -1
  125. package/lib/module/classes/HMSVideoTrack.js +2 -0
  126. package/lib/module/classes/HMSVideoTrack.js.map +1 -1
  127. package/lib/module/classes/HMSVideoTrackSettings.js +0 -3
  128. package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
  129. package/lib/module/classes/HmsView.js +10 -7
  130. package/lib/module/classes/HmsView.js.map +1 -1
  131. package/lib/module/index.js +7 -0
  132. package/lib/module/index.js.map +1 -1
  133. package/lib/typescript/classes/HMSAudioTrack.d.ts +3 -0
  134. package/lib/typescript/classes/HMSAudioTrackSettings.d.ts +3 -0
  135. package/lib/typescript/classes/HMSBrowserRecordingState.d.ts +9 -0
  136. package/lib/typescript/classes/HMSCameraFacing.d.ts +4 -0
  137. package/lib/typescript/classes/HMSConfig.d.ts +2 -4
  138. package/lib/typescript/classes/HMSEncoder.d.ts +14 -12
  139. package/lib/typescript/classes/HMSException.d.ts +22 -0
  140. package/lib/typescript/classes/HMSLocalAudioTrack.d.ts +5 -0
  141. package/lib/typescript/classes/HMSLocalPeer.d.ts +3 -0
  142. package/lib/typescript/classes/HMSLocalVideoTrack.d.ts +4 -0
  143. package/lib/typescript/classes/HMSLogger.d.ts +4 -4
  144. package/lib/typescript/classes/HMSPeer.d.ts +2 -0
  145. package/lib/typescript/classes/HMSPeerUpdate.d.ts +1 -0
  146. package/lib/typescript/classes/HMSPermissions.d.ts +6 -6
  147. package/lib/typescript/classes/HMSRTMPConfig.d.ts +10 -0
  148. package/lib/typescript/classes/HMSRemoteAudioTrack.d.ts +4 -0
  149. package/lib/typescript/classes/HMSRemotePeer.d.ts +3 -0
  150. package/lib/typescript/classes/HMSRemoteVideoTrack.d.ts +4 -0
  151. package/lib/typescript/classes/HMSRoom.d.ts +9 -0
  152. package/lib/typescript/classes/HMSRtmpStreamingState.d.ts +9 -0
  153. package/lib/typescript/classes/HMSSDK.d.ts +36 -6
  154. package/lib/typescript/classes/HMSServerRecordingState.d.ts +9 -0
  155. package/lib/typescript/classes/HMSTrack.d.ts +6 -1
  156. package/lib/typescript/classes/HMSTrackType.d.ts +4 -0
  157. package/lib/typescript/classes/HMSVideoResolution.d.ts +8 -0
  158. package/lib/typescript/classes/HMSVideoSettings.d.ts +3 -3
  159. package/lib/typescript/classes/HMSVideoTrack.d.ts +5 -1
  160. package/lib/typescript/classes/HMSVideoTrackSettings.d.ts +13 -10
  161. package/lib/typescript/classes/HmsView.d.ts +2 -1
  162. package/lib/typescript/index.d.ts +7 -0
  163. package/package.json +1 -1
  164. package/src/classes/HMSAudioTrack.ts +3 -0
  165. package/src/classes/HMSAudioTrackSettings.ts +9 -1
  166. package/src/classes/HMSBrowserRecordingState.ts +11 -0
  167. package/src/classes/HMSCameraFacing.ts +4 -0
  168. package/src/classes/HMSConfig.ts +3 -7
  169. package/src/classes/HMSEncoder.ts +62 -28
  170. package/src/classes/HMSException.ts +33 -0
  171. package/src/classes/HMSHelper.ts +2 -2
  172. package/src/classes/HMSLocalAudioTrack.ts +19 -2
  173. package/src/classes/HMSLocalPeer.ts +3 -0
  174. package/src/classes/HMSLocalVideoTrack.ts +7 -2
  175. package/src/classes/HMSLogger.ts +5 -5
  176. package/src/classes/HMSPeer.ts +3 -0
  177. package/src/classes/HMSPeerUpdate.ts +1 -0
  178. package/src/classes/HMSPermissions.ts +9 -9
  179. package/src/classes/HMSRTMPConfig.ts +15 -0
  180. package/src/classes/HMSRemoteAudioTrack.ts +13 -2
  181. package/src/classes/HMSRemotePeer.ts +3 -0
  182. package/src/classes/HMSRemoteVideoTrack.ts +13 -2
  183. package/src/classes/HMSRoom.ts +12 -0
  184. package/src/classes/HMSRtmpStreamingState.ts +11 -0
  185. package/src/classes/{HMSSDK.ts → HMSSDK.tsx} +284 -42
  186. package/src/classes/HMSServerRecordingState.ts +11 -0
  187. package/src/classes/HMSTrack.ts +9 -15
  188. package/src/classes/HMSTrackType.ts +4 -0
  189. package/src/classes/HMSVideoResolution.ts +9 -0
  190. package/src/classes/HMSVideoSettings.ts +3 -3
  191. package/src/classes/HMSVideoTrack.ts +6 -1
  192. package/src/classes/HMSVideoTrackSettings.ts +13 -10
  193. package/src/classes/HmsView.tsx +4 -0
  194. package/src/index.ts +7 -0
  195. package/ios/Hmssdk.m +0 -8
  196. package/ios/Hmssdk.swift +0 -8
@@ -1,9 +1,11 @@
1
1
  import { HMSVideoTrack } from './HMSVideoTrack';
2
2
  import type { HMSVideoTrackSettings } from './HMSVideoTrackSettings';
3
+ import type { HMSTrackType } from './HMSTrackType';
3
4
  export declare class HMSLocalVideoTrack extends HMSVideoTrack {
4
5
  settings?: HMSVideoTrackSettings;
5
6
  startCapturing?: Function;
6
7
  stopCapturing?: Function;
8
+ id: string;
7
9
  /**
8
10
  * switches camera between front/back
9
11
  *
@@ -18,10 +20,12 @@ export declare class HMSLocalVideoTrack extends HMSVideoTrack {
18
20
  */
19
21
  setMute(isMute: boolean): void;
20
22
  constructor(params: {
23
+ id: string;
21
24
  trackId: string;
22
25
  source?: number | string;
23
26
  trackDescription?: string;
24
27
  isMute?: boolean;
25
28
  settings?: HMSVideoTrackSettings;
29
+ type?: HMSTrackType;
26
30
  });
27
31
  }
@@ -4,12 +4,12 @@ export declare class HMSLogger {
4
4
  private _warning;
5
5
  private _error;
6
6
  constructor(params?: {
7
- verbose: Boolean;
8
- warning: Boolean;
9
- error: Boolean;
7
+ verbose: boolean;
8
+ warning: boolean;
9
+ error: boolean;
10
10
  });
11
11
  verbose(message: string, data: any): void;
12
12
  warn(message: string, data: any): void;
13
13
  error(message: string, data: any): void;
14
- updateLogLevel(level: HMSLogLevel, value: Boolean): void;
14
+ updateLogLevel(level: HMSLogLevel, value: boolean): void;
15
15
  }
@@ -8,6 +8,7 @@ export declare class HMSPeer {
8
8
  isLocal?: boolean;
9
9
  customerUserID?: string;
10
10
  customerDescription?: string;
11
+ metadata?: string;
11
12
  role?: HMSRole;
12
13
  audioTrack?: HMSAudioTrack;
13
14
  videoTrack?: HMSVideoTrack;
@@ -18,6 +19,7 @@ export declare class HMSPeer {
18
19
  isLocal?: boolean;
19
20
  customerUserID?: string;
20
21
  customerDescription?: string;
22
+ metadata?: string;
21
23
  role?: HMSRole;
22
24
  audioTrack?: HMSAudioTrack;
23
25
  videoTrack?: HMSVideoTrack;
@@ -3,6 +3,7 @@ export declare enum HMSPeerUpdate {
3
3
  PEER_LEFT = "PEER_LEFT",
4
4
  AUDIO_TOGGLED = "AUDIO_TOGGLED",
5
5
  VIDEO_TOGGLED = "VIDEO_TOGGLED",
6
+ METADATA_CHANGED = "METADATA_CHANGED",
6
7
  BECAME_DOMINANT_SPEAKER = "BECAME_DOMINANT_SPEAKER",
7
8
  NO_DOMINANT_SPEAKER = "NO_DOMINANT_SPEAKER",
8
9
  RESIGNED_DOMINANT_SPEAKER = "RESIGNED_DOMINANT_SPEAKER",
@@ -1,18 +1,18 @@
1
1
  export declare class HMSPermissions {
2
2
  endRoom?: boolean;
3
3
  removeOthers?: boolean;
4
- stopPresentation?: boolean;
4
+ unmute?: boolean;
5
5
  mute?: boolean;
6
- askToUnmute?: boolean;
7
- muteSelective?: boolean;
8
6
  changeRole?: boolean;
7
+ recording?: boolean;
8
+ rtmp?: boolean;
9
9
  constructor(params?: {
10
10
  endRoom?: boolean;
11
11
  removeOthers?: boolean;
12
- stopPresentation?: boolean;
12
+ unmute?: boolean;
13
13
  mute?: boolean;
14
- askToUnmute?: boolean;
15
- muteSelective?: boolean;
16
14
  changeRole?: boolean;
15
+ recording?: boolean;
16
+ rtmp?: boolean;
17
17
  });
18
18
  }
@@ -0,0 +1,10 @@
1
+ export declare class HMSRTMPConfig {
2
+ meetingURL: string;
3
+ rtmpURLs?: Array<string>;
4
+ record: boolean;
5
+ constructor(params: {
6
+ meetingURL: string;
7
+ rtmpURLs?: Array<string>;
8
+ record: boolean;
9
+ });
10
+ }
@@ -1,3 +1,4 @@
1
+ import type { HMSTrackType } from './HMSTrackType';
1
2
  import { HMSAudioTrack } from './HMSAudioTrack';
2
3
  export declare class HMSRemoteAudioTrack extends HMSAudioTrack {
3
4
  /**
@@ -13,5 +14,8 @@ export declare class HMSRemoteAudioTrack extends HMSAudioTrack {
13
14
  source?: number | string;
14
15
  isMute?: boolean;
15
16
  trackDescription?: string;
17
+ playbackAllowed?: boolean;
18
+ id: string;
19
+ type?: HMSTrackType;
16
20
  });
17
21
  }
@@ -16,6 +16,7 @@ export declare class HMSRemotePeer extends HMSPeer {
16
16
  isLocal?: boolean;
17
17
  customerUserID?: string;
18
18
  customerDescription?: string;
19
+ metadata?: string;
19
20
  audioTrack?: HMSAudioTrack;
20
21
  videoTrack?: HMSVideoTrack;
21
22
  role?: HMSRole;
@@ -26,6 +27,7 @@ export declare class HMSRemotePeer extends HMSPeer {
26
27
  isMute?: boolean;
27
28
  trackDescription?: string;
28
29
  playbackAllowed?: boolean;
30
+ id: string;
29
31
  };
30
32
  remoteVideoTrackData?: {
31
33
  trackId: string;
@@ -34,6 +36,7 @@ export declare class HMSRemotePeer extends HMSPeer {
34
36
  isMute?: boolean;
35
37
  layer?: any;
36
38
  playbackAllowed?: boolean;
39
+ id: string;
37
40
  };
38
41
  });
39
42
  }
@@ -1,4 +1,5 @@
1
1
  import { HMSVideoTrack } from './HMSVideoTrack';
2
+ import type { HMSTrackType } from './HMSTrackType';
2
3
  export declare class HMSRemoteVideoTrack extends HMSVideoTrack {
3
4
  layer?: any;
4
5
  /**
@@ -15,5 +16,8 @@ export declare class HMSRemoteVideoTrack extends HMSVideoTrack {
15
16
  trackDescription?: string;
16
17
  isMute?: boolean;
17
18
  layer?: any;
19
+ playbackAllowed?: boolean;
20
+ id: string;
21
+ type?: HMSTrackType;
18
22
  });
19
23
  }
@@ -1,13 +1,22 @@
1
1
  import type { HMSPeer } from './HMSPeer';
2
+ import type { HMSRtmpStreamingState } from './HMSRtmpStreamingState';
3
+ import type { HMSServerRecordingState } from './HMSServerRecordingState';
4
+ import type { HMSBrowserRecordingState } from './HMSBrowserRecordingState';
2
5
  export declare class HMSRoom {
3
6
  id: string;
4
7
  name: string;
5
8
  metaData?: string;
6
9
  peers: HMSPeer[];
10
+ browserRecordingState: HMSBrowserRecordingState;
11
+ rtmpHMSRtmpStreamingState: HMSRtmpStreamingState;
12
+ serverRecordingState: HMSServerRecordingState;
7
13
  constructor(params: {
8
14
  id: string;
9
15
  name: string;
10
16
  metaData?: string;
11
17
  peers: HMSPeer[];
18
+ browserRecordingState: HMSBrowserRecordingState;
19
+ rtmpHMSRtmpStreamingState: HMSRtmpStreamingState;
20
+ serverRecordingState: HMSServerRecordingState;
12
21
  });
13
22
  }
@@ -0,0 +1,9 @@
1
+ import type { HMSException } from './HMSException';
2
+ export declare class HMSRtmpStreamingState {
3
+ running: string;
4
+ error: HMSException;
5
+ constructor(params: {
6
+ running: string;
7
+ error: HMSException;
8
+ });
9
+ }
@@ -1,3 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { ViewStyle } from 'react-native';
1
3
  import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
2
4
  import type { HMSConfig } from './HMSConfig';
3
5
  import type { HMSLocalPeer } from './HMSLocalPeer';
@@ -5,13 +7,28 @@ import type { HMSRemotePeer } from './HMSRemotePeer';
5
7
  import type { HMSRoom } from './HMSRoom';
6
8
  import type { HMSRole } from './HMSRole';
7
9
  import type { HMSTrack } from './HMSTrack';
10
+ import type { HMSTrackType } from './HMSTrackType';
8
11
  import type { HMSLogger } from './HMSLogger';
12
+ import type { HMSPeer } from './HMSPeer';
13
+ import { HMSVideoViewMode } from './HMSVideoViewMode';
14
+ import type { HMSTrackSettings } from './HMSTrackSettings';
15
+ import type { HMSRTMPConfig } from './HMSRTMPConfig';
16
+ interface HmsComponentProps {
17
+ trackId: string;
18
+ sink: boolean;
19
+ style: ViewStyle;
20
+ mirror?: boolean;
21
+ scaleType: HMSVideoViewMode;
22
+ id?: string | null;
23
+ }
9
24
  export declare class HMSSDK {
10
25
  room?: HMSRoom;
11
26
  localPeer?: HMSLocalPeer;
12
27
  remotePeers?: HMSRemotePeer[];
13
28
  knownRoles?: HMSRole[];
14
29
  logger?: HMSLogger;
30
+ id: string;
31
+ private muteStatus;
15
32
  onPreviewDelegate?: any;
16
33
  onJoinDelegate?: any;
17
34
  onRoomDelegate?: any;
@@ -25,6 +42,7 @@ export declare class HMSSDK {
25
42
  onRoleChangeRequestDelegate?: any;
26
43
  onChangeTrackStateRequestDelegate?: any;
27
44
  onRemovedFromRoomDelegate?: any;
45
+ constructor(id: string);
28
46
  /**
29
47
  * - Returns an instance of [HMSSDK]{@link HMSSDK}
30
48
  * - This function must be called to get an instance of HMSSDK class and only then user can interact with its methods
@@ -33,9 +51,13 @@ export declare class HMSSDK {
33
51
  * @returns
34
52
  * @memberof HMSSDK
35
53
  */
36
- static build(): HMSSDK;
54
+ static build(params?: {
55
+ trackSettings?: HMSTrackSettings;
56
+ }): Promise<HMSSDK>;
57
+ destroy: () => void;
37
58
  attachPreviewListener: () => void;
38
59
  attachListeners: () => void;
60
+ removeListeners: () => void;
39
61
  /**
40
62
  * takes an instance of [HMSConfig]{@link HMSConfig} and joins the room
41
63
  * after joining the room user will start receiving the events and updates of the room
@@ -45,21 +67,28 @@ export declare class HMSSDK {
45
67
  */
46
68
  join: (config: HMSConfig) => Promise<void>;
47
69
  preview: (config: HMSConfig) => void;
70
+ HmsView: ({ sink, trackId, style, mirror, scaleType, }: HmsComponentProps) => JSX.Element;
48
71
  /**
49
72
  * Calls leave function of native sdk and session of current user is invalidated
50
73
  *
51
74
  * @memberof HMSSDK
52
75
  */
53
- leave: () => void;
54
- sendBroadcastMessage: (message: string) => void;
55
- sendGroupMessage: (message: string, roles: HMSRole[]) => void;
56
- sendDirectMessage: (message: string, peerId: string) => void;
57
- changeRole: (peerId: string, role: string, force?: boolean) => void;
76
+ leave: () => Promise<void>;
77
+ sendBroadcastMessage: (message: string, type?: string | undefined) => void;
78
+ sendGroupMessage: (message: string, roles: HMSRole[], type?: string | undefined) => void;
79
+ sendDirectMessage: (message: string, peerId: string, type?: string | undefined) => void;
80
+ changeMetadata: (metadata: string) => void;
81
+ startRTMPOrRecording: (data: HMSRTMPConfig) => Promise<any>;
82
+ stopRtmpAndRecording: () => Promise<any>;
83
+ changeRole: (peer: HMSPeer, role: HMSRole, force?: boolean) => void;
58
84
  changeTrackState: (track: HMSTrack, mute: boolean) => void;
85
+ changeTrackStateRoles: (type: HMSTrackType, mute: boolean, source: string, roles: Array<HMSRole>) => void;
59
86
  removePeer: (peerId: string, reason: string) => void;
60
87
  endRoom: (lock: boolean, reason: string) => void;
61
88
  acceptRoleChange: () => void;
62
89
  muteAllPeersAudio: (mute: boolean) => void;
90
+ getRoom: () => Promise<HMSRoom>;
91
+ setVolume: (track: HMSTrack, volume: number) => void;
63
92
  /**
64
93
  * - This is a prototype event listener that takes action and listens for updates related to that particular action
65
94
  * - This method will be @deprecated in future and event listener will be passed in join method
@@ -99,3 +128,4 @@ export declare class HMSSDK {
99
128
  reconnectingListener: (data: any) => void;
100
129
  reconnectedListener: (data: any) => void;
101
130
  }
131
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { HMSException } from './HMSException';
2
+ export declare class HMSServerRecordingState {
3
+ running: string;
4
+ error: HMSException;
5
+ constructor(params: {
6
+ running: string;
7
+ error: HMSException;
8
+ });
9
+ }
@@ -1,13 +1,18 @@
1
+ import type { HMSTrackType } from './HMSTrackType';
1
2
  export declare class HMSTrack {
2
3
  trackId: string;
3
4
  source?: number | string;
4
5
  trackDescription?: string;
5
6
  mute?: boolean;
6
- isMute: () => Promise<any>;
7
+ id: string;
8
+ type?: HMSTrackType;
9
+ isMute: () => boolean | undefined;
7
10
  constructor(params: {
8
11
  trackId: string;
9
12
  source?: number | string;
10
13
  trackDescription?: string;
11
14
  isMute?: boolean;
15
+ id: string;
16
+ type?: HMSTrackType;
12
17
  });
13
18
  }
@@ -0,0 +1,4 @@
1
+ export declare enum HMSTrackType {
2
+ AUDIO = "AUDIO",
3
+ VIDEO = "VIDEO"
4
+ }
@@ -0,0 +1,8 @@
1
+ export declare class HMSVideoResolution {
2
+ height?: number;
3
+ width?: number;
4
+ constructor(params: {
5
+ height: number;
6
+ width: number;
7
+ });
8
+ }
@@ -1,15 +1,15 @@
1
- import type { HMSAudioCodec } from './HMSAudioCodec';
1
+ import type { HMSVideoCodec } from '..';
2
2
  export declare class HMSVideoSettings {
3
3
  bitrate?: number;
4
4
  frameRate: number;
5
5
  width: number;
6
6
  height: number;
7
- codec: HMSAudioCodec;
7
+ codec: HMSVideoCodec;
8
8
  constructor(params: {
9
9
  bitrate?: number;
10
10
  frameRate: number;
11
11
  width: number;
12
12
  height: number;
13
- codec: HMSAudioCodec;
13
+ codec: HMSVideoCodec;
14
14
  });
15
15
  }
@@ -1,6 +1,7 @@
1
1
  import { HMSTrack } from './HMSTrack';
2
+ import type { HMSTrackType } from './HMSTrackType';
2
3
  export declare class HMSVideoTrack extends HMSTrack {
3
- isDegraded?: Function;
4
+ isDegraded?: boolean;
4
5
  addSink?: Function;
5
6
  removeSink?: Function;
6
7
  constructor(params: {
@@ -8,5 +9,8 @@ export declare class HMSVideoTrack extends HMSTrack {
8
9
  source?: number | string;
9
10
  trackDescription?: string;
10
11
  isMute?: boolean;
12
+ id: string;
13
+ isDegraded?: boolean;
14
+ type?: HMSTrackType;
11
15
  });
12
16
  }
@@ -1,18 +1,21 @@
1
+ import type { HMSVideoCodec } from './HMSVideoCodec';
1
2
  import type { HMSSimulcastLayerSettings } from './HMSSimulcastLayerSettings';
3
+ import type { HMSCameraFacing } from './HMSCameraFacing';
4
+ import type { HMSVideoResolution } from './HMSVideoResolution';
2
5
  export declare class HMSVideoTrackSettings {
3
- codec?: any;
4
- resolution?: any;
5
- maxBitrate?: number;
6
- maxFrameRate?: number;
7
- cameraFacing?: any;
6
+ codec: HMSVideoCodec;
7
+ resolution: HMSVideoResolution;
8
+ maxBitrate: number;
9
+ maxFrameRate: number;
10
+ cameraFacing: HMSCameraFacing;
8
11
  trackDescription?: string;
9
12
  simulcastSettings?: HMSSimulcastLayerSettings[];
10
13
  constructor(params: {
11
- codec?: any;
12
- resolution?: any;
13
- maxBitrate?: number;
14
- maxFrameRate?: number;
15
- cameraFacing?: any;
14
+ codec: HMSVideoCodec;
15
+ resolution: HMSVideoResolution;
16
+ maxBitrate: number;
17
+ maxFrameRate: number;
18
+ cameraFacing: HMSCameraFacing;
16
19
  trackDescription?: string;
17
20
  simulcastSettings?: HMSSimulcastLayerSettings[];
18
21
  });
@@ -7,6 +7,7 @@ interface HmsComponentProps {
7
7
  style: ViewStyle;
8
8
  mirror?: boolean;
9
9
  scaleType: HMSVideoViewMode;
10
+ id?: string | null;
10
11
  }
11
- export declare const HmsView: ({ sink, trackId, style, mirror, scaleType, }: HmsComponentProps) => JSX.Element;
12
+ export declare const HmsView: ({ sink, trackId, style, id, mirror, scaleType, }: HmsComponentProps) => JSX.Element;
12
13
  export {};
@@ -8,6 +8,7 @@ export * from './classes/HMSVideoSettings';
8
8
  export * from './classes/HMSVideoCodec';
9
9
  export * from './classes/HMSTrackSettings';
10
10
  export * from './classes/HMSTrack';
11
+ export * from './classes/HMSTrackType';
11
12
  export * from './classes/HMSSubscribeSettings';
12
13
  export * from './classes/HMSSimulcastSettings';
13
14
  export * from './classes/HMSSimulcastLayerSettings';
@@ -39,5 +40,11 @@ export * from './classes/HMSVideoViewMode';
39
40
  export * from './classes/HMSChangeTrackStateRequest';
40
41
  export * from './classes/HMSSpeaker';
41
42
  export * from './classes/HMSSpeakerUpdate';
43
+ export * from './classes/HMSCameraFacing';
44
+ export * from './classes/HMSException';
45
+ export * from './classes/HMSRtmpStreamingState';
46
+ export * from './classes/HMSServerRecordingState';
47
+ export * from './classes/HMSBrowserRecordingState';
48
+ export * from './classes/HMSRTMPConfig';
42
49
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
43
50
  export default HmsManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@100mslive/react-native-hms",
3
- "version": "0.7.2",
3
+ "version": "0.8.1",
4
4
  "description": "The React Native package for 100ms SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -1,4 +1,5 @@
1
1
  import { HMSTrack } from './HMSTrack';
2
+ import type { HMSTrackType } from './HMSTrackType';
2
3
 
3
4
  export class HMSAudioTrack extends HMSTrack {
4
5
  constructor(params?: {
@@ -6,6 +7,8 @@ export class HMSAudioTrack extends HMSTrack {
6
7
  source?: number | string;
7
8
  trackDescription?: string;
8
9
  isMute?: boolean;
10
+ id: string;
11
+ type?: HMSTrackType;
9
12
  }) {
10
13
  if (params) {
11
14
  super(params);
@@ -1,8 +1,16 @@
1
+ import type { HMSAudioCodec } from './HMSAudioCodec';
2
+
1
3
  export class HMSAudioTrackSettings {
2
4
  maxBitrate?: number;
3
5
  trackDescription?: string;
4
- constructor(params: { maxBitrate: number; trackDescription?: string }) {
6
+ codec?: HMSAudioCodec;
7
+ constructor(params: {
8
+ maxBitrate: number;
9
+ trackDescription?: string;
10
+ codec: HMSAudioCodec;
11
+ }) {
5
12
  this.maxBitrate = params.maxBitrate;
6
13
  this.trackDescription = params.trackDescription;
14
+ this.codec = params.codec;
7
15
  }
8
16
  }
@@ -0,0 +1,11 @@
1
+ import type { HMSException } from './HMSException';
2
+
3
+ export class HMSBrowserRecordingState {
4
+ running: string;
5
+ error: HMSException;
6
+
7
+ constructor(params: { running: string; error: HMSException }) {
8
+ this.running = params.running;
9
+ this.error = params.error;
10
+ }
11
+ }
@@ -0,0 +1,4 @@
1
+ export enum HMSCameraFacing {
2
+ FRONT = 'FRONT',
3
+ BACK = 'BACK',
4
+ }
@@ -1,22 +1,18 @@
1
1
  export class HMSConfig {
2
- // endpoint: string;
3
2
  username: string;
4
3
  authToken: string;
5
- roomID: string;
6
- userID?: string;
7
4
  endpoint?: string;
5
+ metadata?: string;
8
6
 
9
7
  constructor(params: {
10
8
  username: string;
11
- roomID: string;
12
9
  authToken: string;
13
- userID?: string;
14
10
  endpoint?: string;
11
+ metadata?: string;
15
12
  }) {
16
- this.roomID = params.roomID;
17
13
  this.username = params.username;
18
14
  this.authToken = params.authToken;
19
- this.userID = params.userID;
20
15
  this.endpoint = params.endpoint;
16
+ this.metadata = params.metadata;
21
17
  }
22
18
  }