@100mslive/react-native-hms 0.9.1 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +239 -26
  2. package/android/.gradle/6.9/fileHashes/fileHashes.bin +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/outputFiles.bin +0 -0
  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/build.gradle +1 -1
  10. package/android/src/main/java/com/reactnativehmssdk/HmsDecoder.kt +22 -0
  11. package/android/src/main/java/com/reactnativehmssdk/HmsHelper.kt +197 -6
  12. package/android/src/main/java/com/reactnativehmssdk/HmsModule.kt +2 -2
  13. package/android/src/main/java/com/reactnativehmssdk/HmsSDK.kt +36 -77
  14. package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +16 -0
  15. package/android/src/main/java/com/reactnativehmssdk/HmsView.kt +24 -33
  16. package/android/src/main/java/com/reactnativehmssdk/HmssdkViewManager.kt +15 -2
  17. package/ios/HmsDecoder.swift +47 -4
  18. package/ios/HmsHelper.swift +14 -0
  19. package/ios/HmsSDK.swift +13 -7
  20. package/lib/commonjs/classes/HMSConfig.js +3 -0
  21. package/lib/commonjs/classes/HMSConfig.js.map +1 -1
  22. package/lib/commonjs/classes/HMSEncoder.js +33 -2
  23. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  24. package/lib/commonjs/classes/HMSHLSConfig.js +3 -0
  25. package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -1
  26. package/lib/commonjs/classes/HMSHLSRecordingConfig.js +23 -0
  27. package/lib/commonjs/classes/HMSHLSRecordingConfig.js.map +1 -0
  28. package/lib/commonjs/classes/HMSHLSRecordingState.js +29 -0
  29. package/lib/commonjs/classes/HMSHLSRecordingState.js.map +1 -0
  30. package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
  31. package/lib/commonjs/classes/HMSLogger.js +21 -21
  32. package/lib/commonjs/classes/HMSLogger.js.map +1 -1
  33. package/lib/commonjs/classes/HMSMessage.js +4 -1
  34. package/lib/commonjs/classes/HMSMessage.js.map +1 -1
  35. package/lib/commonjs/classes/HMSMessageRecipient.js +26 -0
  36. package/lib/commonjs/classes/HMSMessageRecipient.js.map +1 -0
  37. package/lib/commonjs/classes/HMSMessageRecipientType.js +15 -0
  38. package/lib/commonjs/classes/HMSMessageRecipientType.js.map +1 -0
  39. package/lib/commonjs/classes/HMSNetworkQuality.js +20 -0
  40. package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -0
  41. package/lib/commonjs/classes/HMSPeer.js +3 -0
  42. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  43. package/lib/commonjs/classes/HMSPeerUpdate.js +1 -8
  44. package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
  45. package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
  46. package/lib/commonjs/classes/HMSRoom.js +3 -0
  47. package/lib/commonjs/classes/HMSRoom.js.map +1 -1
  48. package/lib/commonjs/classes/HMSSDK.js +22 -7
  49. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  50. package/lib/commonjs/classes/HmsView.js +10 -6
  51. package/lib/commonjs/classes/HmsView.js.map +1 -1
  52. package/lib/commonjs/index.js +70 -0
  53. package/lib/commonjs/index.js.map +1 -1
  54. package/lib/module/classes/HMSConfig.js +3 -0
  55. package/lib/module/classes/HMSConfig.js.map +1 -1
  56. package/lib/module/classes/HMSEncoder.js +31 -2
  57. package/lib/module/classes/HMSEncoder.js.map +1 -1
  58. package/lib/module/classes/HMSHLSConfig.js +3 -0
  59. package/lib/module/classes/HMSHLSConfig.js.map +1 -1
  60. package/lib/module/classes/HMSHLSRecordingConfig.js +14 -0
  61. package/lib/module/classes/HMSHLSRecordingConfig.js.map +1 -0
  62. package/lib/module/classes/HMSHLSRecordingState.js +20 -0
  63. package/lib/module/classes/HMSHLSRecordingState.js.map +1 -0
  64. package/lib/module/classes/HMSLocalPeer.js.map +1 -1
  65. package/lib/module/classes/HMSLogger.js +21 -21
  66. package/lib/module/classes/HMSLogger.js.map +1 -1
  67. package/lib/module/classes/HMSMessage.js +4 -1
  68. package/lib/module/classes/HMSMessage.js.map +1 -1
  69. package/lib/module/classes/HMSMessageRecipient.js +17 -0
  70. package/lib/module/classes/HMSMessageRecipient.js.map +1 -0
  71. package/lib/module/classes/HMSMessageRecipientType.js +8 -0
  72. package/lib/module/classes/HMSMessageRecipientType.js.map +1 -0
  73. package/lib/module/classes/HMSNetworkQuality.js +11 -0
  74. package/lib/module/classes/HMSNetworkQuality.js.map +1 -0
  75. package/lib/module/classes/HMSPeer.js +3 -0
  76. package/lib/module/classes/HMSPeer.js.map +1 -1
  77. package/lib/module/classes/HMSPeerUpdate.js +1 -8
  78. package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
  79. package/lib/module/classes/HMSRemotePeer.js.map +1 -1
  80. package/lib/module/classes/HMSRoom.js +3 -0
  81. package/lib/module/classes/HMSRoom.js.map +1 -1
  82. package/lib/module/classes/HMSSDK.js +22 -6
  83. package/lib/module/classes/HMSSDK.js.map +1 -1
  84. package/lib/module/classes/HmsView.js +10 -6
  85. package/lib/module/classes/HmsView.js.map +1 -1
  86. package/lib/module/index.js +5 -0
  87. package/lib/module/index.js.map +1 -1
  88. package/lib/typescript/classes/HMSConfig.d.ts +2 -0
  89. package/lib/typescript/classes/HMSEncoder.d.ts +4 -0
  90. package/lib/typescript/classes/HMSHLSConfig.d.ts +5 -2
  91. package/lib/typescript/classes/HMSHLSRecordingConfig.d.ts +8 -0
  92. package/lib/typescript/classes/HMSHLSRecordingState.d.ts +12 -0
  93. package/lib/typescript/classes/HMSLocalPeer.d.ts +2 -0
  94. package/lib/typescript/classes/HMSMessage.d.ts +8 -4
  95. package/lib/typescript/classes/HMSMessageRecipient.d.ts +13 -0
  96. package/lib/typescript/classes/HMSMessageRecipientType.d.ts +5 -0
  97. package/lib/typescript/classes/HMSNetworkQuality.d.ts +6 -0
  98. package/lib/typescript/classes/HMSPeer.d.ts +3 -0
  99. package/lib/typescript/classes/HMSPeerUpdate.d.ts +1 -8
  100. package/lib/typescript/classes/HMSRemotePeer.d.ts +2 -0
  101. package/lib/typescript/classes/HMSRoom.d.ts +3 -0
  102. package/lib/typescript/classes/HMSSDK.d.ts +299 -10
  103. package/lib/typescript/classes/HmsView.d.ts +4 -2
  104. package/lib/typescript/index.d.ts +5 -0
  105. package/package.json +1 -1
  106. package/react-native-hms.podspec +1 -1
  107. package/src/classes/HMSConfig.ts +3 -0
  108. package/src/classes/HMSEncoder.ts +62 -17
  109. package/src/classes/HMSHLSConfig.ts +8 -2
  110. package/src/classes/HMSHLSRecordingConfig.ts +9 -0
  111. package/src/classes/HMSHLSRecordingState.ts +18 -0
  112. package/src/classes/HMSLocalPeer.ts +2 -0
  113. package/src/classes/HMSLogger.ts +3 -3
  114. package/src/classes/HMSMessage.ts +11 -5
  115. package/src/classes/HMSMessageRecipient.ts +19 -0
  116. package/src/classes/HMSMessageRecipientType.ts +5 -0
  117. package/src/classes/HMSNetworkQuality.ts +7 -0
  118. package/src/classes/HMSPeer.ts +4 -2
  119. package/src/classes/HMSPeerUpdate.ts +1 -8
  120. package/src/classes/HMSRemotePeer.ts +2 -0
  121. package/src/classes/HMSRoom.ts +4 -0
  122. package/src/classes/HMSSDK.tsx +306 -11
  123. package/src/classes/HmsView.tsx +14 -6
  124. package/src/index.ts +5 -0
@@ -3,10 +3,12 @@ export declare class HMSConfig {
3
3
  authToken: string;
4
4
  endpoint?: string;
5
5
  metadata?: string;
6
+ captureNetworkQualityInPreview?: boolean;
6
7
  constructor(params: {
7
8
  username: string;
8
9
  authToken: string;
9
10
  endpoint?: string;
10
11
  metadata?: string;
12
+ captureNetworkQualityInPreview?: boolean;
11
13
  });
12
14
  }
@@ -20,6 +20,8 @@ import { HMSRemoteVideoTrack } from './HMSRemoteVideoTrack';
20
20
  import { HMSSpeaker } from './HMSSpeaker';
21
21
  import { HMSSpeakerUpdate } from './HMSSpeakerUpdate';
22
22
  import { HMSBrowserRecordingState, HMSHLSStreamingState, HMSHLSVariant, HMSRtmpStreamingState, HMSServerRecordingState } from '..';
23
+ import { HMSHLSRecordingState } from './HMSHLSRecordingState';
24
+ import { HMSNetworkQuality } from './HMSNetworkQuality';
23
25
  export declare class HMSEncoder {
24
26
  static encodeHmsRoom(room: HMSRoom, id: string): HMSRoom;
25
27
  static encodeHmsPeers(peers: any, id: string): HMSPeer[];
@@ -55,5 +57,7 @@ export declare class HMSEncoder {
55
57
  static encodeServerRecordingState(data: any): HMSServerRecordingState;
56
58
  static encodeRTMPStreamingState(data: any): HMSRtmpStreamingState;
57
59
  static encodeHLSStreamingState(data: any): HMSHLSStreamingState;
60
+ static encodeHLSRecordingState(data: any): HMSHLSRecordingState | undefined;
58
61
  static encodeHLSVariants(data: any): HMSHLSVariant[];
62
+ static encodeHMSNetworkQuality(data: any): HMSNetworkQuality | undefined;
59
63
  }
@@ -1,7 +1,10 @@
1
1
  import type { HMSHLSMeetingURLVariant } from './HMSHLSMeetingURLVariant';
2
+ import type { HMSHLSRecordingConfig } from './HMSHLSRecordingConfig';
2
3
  export declare class HMSHLSConfig {
3
- meetingURLVariants?: Array<HMSHLSMeetingURLVariant>;
4
+ hlsRecordingConfig?: HMSHLSRecordingConfig;
5
+ meetingURLVariants: Array<HMSHLSMeetingURLVariant>;
4
6
  constructor(params: {
5
- meetingURLVariants?: Array<HMSHLSMeetingURLVariant>;
7
+ hlsRecordingConfig?: HMSHLSRecordingConfig;
8
+ meetingURLVariants: Array<HMSHLSMeetingURLVariant>;
6
9
  });
7
10
  }
@@ -0,0 +1,8 @@
1
+ export declare class HMSHLSRecordingConfig {
2
+ singleFilePerLayer: boolean;
3
+ videoOnDemand: boolean;
4
+ constructor(params: {
5
+ singleFilePerLayer: boolean;
6
+ videoOnDemand: boolean;
7
+ });
8
+ }
@@ -0,0 +1,12 @@
1
+ export declare class HMSHLSRecordingState {
2
+ singleFilePerLayer: boolean;
3
+ videoOnDemand: boolean;
4
+ running: boolean;
5
+ startedAt?: Date;
6
+ constructor(params: {
7
+ singleFilePerLayer: boolean;
8
+ videoOnDemand: boolean;
9
+ running: boolean;
10
+ startedAt?: Date;
11
+ });
12
+ }
@@ -8,6 +8,7 @@ import { HMSLocalAudioTrack } from './HMSLocalAudioTrack';
8
8
  import { HMSLocalVideoTrack } from './HMSLocalVideoTrack';
9
9
  import type { HMSRole } from './HMSRole';
10
10
  import type { HMSTrackType } from './HMSTrackType';
11
+ import type { HMSNetworkQuality } from './HMSNetworkQuality';
11
12
  export declare class HMSLocalPeer extends HMSPeer {
12
13
  private localAudio?;
13
14
  private localVideo?;
@@ -22,6 +23,7 @@ export declare class HMSLocalPeer extends HMSPeer {
22
23
  metadata?: string;
23
24
  audioTrack?: HMSAudioTrack;
24
25
  videoTrack?: HMSVideoTrack;
26
+ networkQuality?: HMSNetworkQuality;
25
27
  role?: HMSRole;
26
28
  auxiliaryTracks?: HMSTrack[];
27
29
  localAudioTrackData?: {
@@ -1,12 +1,16 @@
1
+ import type { HMSMessageRecipient } from './HMSMessageRecipient';
2
+ import type { HMSPeer } from './HMSPeer';
1
3
  export declare class HMSMessage {
2
4
  message: string;
3
5
  type: string;
4
- time?: string;
5
- sender?: string;
6
+ time: Date;
7
+ sender: HMSPeer;
8
+ recipient: HMSMessageRecipient;
6
9
  constructor(params: {
7
10
  message: string;
8
11
  type: string;
9
- time?: string;
10
- sender?: string;
12
+ time: string;
13
+ sender: HMSPeer;
14
+ recipient: HMSMessageRecipient;
11
15
  });
12
16
  }
@@ -0,0 +1,13 @@
1
+ import type { HMSMessageRecipientType } from './HMSMessageRecipientType';
2
+ import type { HMSPeer } from './HMSPeer';
3
+ import type { HMSRole } from './HMSRole';
4
+ export declare class HMSMessageRecipient {
5
+ recipientType?: HMSMessageRecipientType;
6
+ recipientPeer?: HMSPeer;
7
+ recipientRoles?: HMSRole[];
8
+ constructor(params: {
9
+ recipientType: HMSMessageRecipientType;
10
+ recipientPeer?: HMSPeer;
11
+ recipientRoles?: HMSRole[];
12
+ });
13
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum HMSMessageRecipientType {
2
+ BROADCAST = "BROADCAST",
3
+ PEER = "PEER",
4
+ ROLES = "ROLES"
5
+ }
@@ -0,0 +1,6 @@
1
+ export declare class HMSNetworkQuality {
2
+ downlinkQuality: number;
3
+ constructor(params: {
4
+ downlinkQuality: number;
5
+ });
6
+ }
@@ -1,4 +1,5 @@
1
1
  import type { HMSAudioTrack } from './HMSAudioTrack';
2
+ import type { HMSNetworkQuality } from './HMSNetworkQuality';
2
3
  import type { HMSRole } from './HMSRole';
3
4
  import type { HMSTrack } from './HMSTrack';
4
5
  import type { HMSVideoTrack } from './HMSVideoTrack';
@@ -10,6 +11,7 @@ export declare class HMSPeer {
10
11
  customerDescription?: string;
11
12
  metadata?: string;
12
13
  role?: HMSRole;
14
+ networkQuality?: HMSNetworkQuality;
13
15
  audioTrack?: HMSAudioTrack;
14
16
  videoTrack?: HMSVideoTrack;
15
17
  auxiliaryTracks?: HMSTrack[];
@@ -21,6 +23,7 @@ export declare class HMSPeer {
21
23
  customerDescription?: string;
22
24
  metadata?: string;
23
25
  role?: HMSRole;
26
+ networkQuality?: HMSNetworkQuality;
24
27
  audioTrack?: HMSAudioTrack;
25
28
  videoTrack?: HMSVideoTrack;
26
29
  auxiliaryTracks?: HMSTrack[];
@@ -1,15 +1,8 @@
1
1
  export declare enum HMSPeerUpdate {
2
2
  PEER_JOINED = "PEER_JOINED",
3
3
  PEER_LEFT = "PEER_LEFT",
4
- AUDIO_TOGGLED = "AUDIO_TOGGLED",
5
- VIDEO_TOGGLED = "VIDEO_TOGGLED",
6
4
  METADATA_CHANGED = "METADATA_CHANGED",
7
- BECAME_DOMINANT_SPEAKER = "BECAME_DOMINANT_SPEAKER",
8
- NO_DOMINANT_SPEAKER = "NO_DOMINANT_SPEAKER",
9
- RESIGNED_DOMINANT_SPEAKER = "RESIGNED_DOMINANT_SPEAKER",
10
- STARTED_SPEAKING = "STARTED_SPEAKING",
11
- STOPPED_SPEAKING = "STOPPED_SPEAKING",
12
5
  ROLE_CHANGED = "ROLE_CHANGED",
13
6
  NAME_CHANGED = "NAME_CHANGED",
14
- DEFAULT_UPDATE = "DEFAULT_UPDATE"
7
+ NETWORK_QUALITY_UPDATED = "NETWORK_QUALITY_UPDATED"
15
8
  }
@@ -1,4 +1,5 @@
1
1
  import type { HMSAudioTrack } from './HMSAudioTrack';
2
+ import type { HMSNetworkQuality } from './HMSNetworkQuality';
2
3
  import { HMSPeer } from './HMSPeer';
3
4
  import { HMSRemoteAudioTrack } from './HMSRemoteAudioTrack';
4
5
  import { HMSRemoteVideoTrack } from './HMSRemoteVideoTrack';
@@ -20,6 +21,7 @@ export declare class HMSRemotePeer extends HMSPeer {
20
21
  audioTrack?: HMSAudioTrack;
21
22
  videoTrack?: HMSVideoTrack;
22
23
  role?: HMSRole;
24
+ networkQuality?: HMSNetworkQuality;
23
25
  auxiliaryTracks?: HMSTrack[];
24
26
  remoteAudioTrackData?: {
25
27
  trackId: string;
@@ -3,6 +3,7 @@ import type { HMSRtmpStreamingState } from './HMSRtmpStreamingState';
3
3
  import type { HMSServerRecordingState } from './HMSServerRecordingState';
4
4
  import type { HMSBrowserRecordingState } from './HMSBrowserRecordingState';
5
5
  import type { HMSHLSStreamingState } from './HMSHLSStreamingState';
6
+ import type { HMSHLSRecordingState } from './HMSHLSRecordingState';
6
7
  export declare class HMSRoom {
7
8
  id: string;
8
9
  name: string;
@@ -12,6 +13,7 @@ export declare class HMSRoom {
12
13
  rtmpHMSRtmpStreamingState: HMSRtmpStreamingState;
13
14
  serverRecordingState: HMSServerRecordingState;
14
15
  hlsStreamingState: HMSHLSStreamingState;
16
+ hlsRecordingState?: HMSHLSRecordingState;
15
17
  peerCount: number;
16
18
  constructor(params: {
17
19
  id: string;
@@ -22,6 +24,7 @@ export declare class HMSRoom {
22
24
  rtmpHMSRtmpStreamingState: HMSRtmpStreamingState;
23
25
  serverRecordingState: HMSServerRecordingState;
24
26
  hlsStreamingState: HMSHLSStreamingState;
27
+ hlsRecordingState?: HMSHLSRecordingState;
25
28
  peerCount: number;
26
29
  });
27
30
  }
@@ -10,7 +10,7 @@ import type { HMSTrack } from './HMSTrack';
10
10
  import type { HMSTrackType } from './HMSTrackType';
11
11
  import type { HMSLogger } from './HMSLogger';
12
12
  import type { HMSPeer } from './HMSPeer';
13
- import { HMSVideoViewMode } from './HMSVideoViewMode';
13
+ import type { HMSVideoViewMode } from './HMSVideoViewMode';
14
14
  import type { HMSTrackSettings } from './HMSTrackSettings';
15
15
  import type { HMSRTMPConfig } from './HMSRTMPConfig';
16
16
  import type { HMSHLSConfig } from './HMSHLSConfig';
@@ -19,8 +19,10 @@ interface HmsComponentProps {
19
19
  sink: boolean;
20
20
  style: ViewStyle;
21
21
  mirror?: boolean;
22
- scaleType: HMSVideoViewMode;
22
+ scaleType?: HMSVideoViewMode;
23
+ screenshot?: boolean;
23
24
  id?: string | null;
25
+ setZOrderMediaOverlay?: boolean;
24
26
  }
25
27
  export declare class HMSSDK {
26
28
  room?: HMSRoom;
@@ -51,7 +53,7 @@ export declare class HMSSDK {
51
53
  constructor(id: string);
52
54
  /**
53
55
  * - Returns an instance of [HMSSDK]{@link HMSSDK}
54
- * - This function must be called to get an instance of HMSSDK class and only then user can interact with its methods
56
+ * - This function must be called to get an instance of HMSSDK class and only then user can interact with its methods.
55
57
  *
56
58
  * @static
57
59
  * @returns
@@ -60,58 +62,332 @@ export declare class HMSSDK {
60
62
  static build(params?: {
61
63
  trackSettings: HMSTrackSettings;
62
64
  }): Promise<HMSSDK>;
65
+ /**
66
+ * - Returns the instance of logger which can be used to manipulate log levels.
67
+ * @returns @instance HMSLogger
68
+ * @memberof HMSSDK
69
+ */
63
70
  static getLogger(): HMSLogger | undefined;
71
+ /**
72
+ * - Updates the logger for this instance of HMSSDK
73
+ * @param {HMSLogger} hmsLogger
74
+ * @memberof HMSSDK
75
+ */
64
76
  setLogger: (hmsLogger: HMSLogger) => void;
77
+ /**
78
+ * - Calls removeListeners that in turn breaks all connections with native listeners.
79
+ *
80
+ * @memberof HMSSDK
81
+ */
65
82
  destroy: () => void;
83
+ /**
84
+ * - Attaches preview listener for native callbacks.
85
+ * Note:this function connects sdk to native side and not app to sdk.
86
+ *
87
+ * @memberof HMSSDK
88
+ */
66
89
  attachPreviewListener: () => void;
90
+ /**
91
+ * - Attaches all the listeners to native callbacks.
92
+ * Note: this function connects sdk to native side and not app to sdk.
93
+ * @memberof HMSSDK
94
+ */
67
95
  attachListeners: () => void;
96
+ /**
97
+ * Disconnects all the listeners of this sdk from native listeners.
98
+ * Note: this function is only called from destroy function and should only be called when the current instance of {@link HMSSDK} is not required anymore.
99
+ * @memberof HMSSDK
100
+ */
68
101
  removeListeners: () => void;
69
102
  /**
70
- * takes an instance of [HMSConfig]{@link HMSConfig} and joins the room
71
- * after joining the room user will start receiving the events and updates of the room
103
+ * takes an instance of [HMSConfig]{@link HMSConfig} and joins the room.
104
+ * after joining the room user will start receiving the events and updates of the room.
105
+ *
106
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/join} for more info
72
107
  *
73
108
  * @param {HMSConfig} config
74
109
  * @memberof HMSSDK
75
110
  */
76
111
  join: (config: HMSConfig) => Promise<void>;
112
+ /**
113
+ * - preview function is used to initiate a preview for the localPeer.
114
+ * - We can call this function and wait for a response in previewListener, the response will contain previewTracks for local peer.
115
+ *
116
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/preview} for more info
117
+ *
118
+ * @param {HMSConfig} config
119
+ * @memberof HMSSDK
120
+ */
77
121
  preview: (config: HMSConfig) => void;
122
+ /**
123
+ * - previewForRole can be used when there is role change request for current localPeer and we want
124
+ * to show the localPeer how the tracks look before publishing them to room.
125
+ *
126
+ * - It requires a role of type [HMSRole]{@link HMSRole} for which we want to preview the tracks.
127
+ *
128
+ * checkout {@link https://www.100ms.live/docs/react-native} for more info
129
+ *
130
+ * @param {HMSRole}
131
+ * @memberof HMSSDK
132
+ */
78
133
  previewForRole: (role: HMSRole) => Promise<any>;
79
- HmsView: ({ sink, trackId, style, mirror, scaleType, }: HmsComponentProps) => JSX.Element;
80
134
  /**
81
- * Calls leave function of native sdk and session of current user is invalidated
135
+ * - HmsView is react component that takes one track and starts showing that track on a tile.
136
+ * - The appearance of tile is completely customizable with style prop.
137
+ * - setting sink true or false for a video tile will add or remove sink for a video.
138
+ * - scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
139
+ *
140
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/render-video} for more info
141
+ *
142
+ * @param {HmsComponentProps}
143
+ * @memberof HMSSDK
144
+ */
145
+ HmsView: ({ sink, trackId, style, mirror, scaleType, screenshot, setZOrderMediaOverlay, }: HmsComponentProps) => JSX.Element;
146
+ /**
147
+ * Calls leave function of native sdk and session of current user is invalidated.
148
+ *
149
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/leave} for more info
82
150
  *
83
151
  * @memberof HMSSDK
84
152
  */
85
153
  leave: () => Promise<any>;
154
+ /**
155
+ * - This function sends message to all the peers in the room, the get the message in onMessage listener.
156
+ *
157
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
158
+ *
159
+ * @param {message: string} and @param {type: string}
160
+ * @memberof HMSSDK
161
+ */
86
162
  sendBroadcastMessage: (message: string, type?: string) => Promise<any>;
163
+ /**
164
+ * - sendGroupMessage sends a message to specific set of roles, whoever has any of those role in room
165
+ * will get the message in onMessage listener.
166
+ *
167
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
168
+ *
169
+ * @memberof HMSSDK
170
+ */
87
171
  sendGroupMessage: (message: string, roles: HMSRole[], type?: string) => Promise<any>;
172
+ /**
173
+ * - sendDirectMessage sends a private message to a single peer, only that peer will get the message
174
+ * in onMessage Listener.
175
+ *
176
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
177
+ *
178
+ * @memberof HMSSDK
179
+ */
88
180
  sendDirectMessage: (message: string, peer: HMSPeer, type?: string) => Promise<any>;
181
+ /**
182
+ * - changeMetadata changes a specific field in localPeer which is [metadata] it is a string that can
183
+ * be used for various functionalities like raiseHand, beRightBack and many more that explains the
184
+ * current status of the peer.
185
+ *
186
+ * - it is advised to use a json object in string format to store multiple dataPoints in metadata.
187
+ *
188
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-metadata} for more info
189
+ *
190
+ * @param {string}
191
+ * @memberof HMSSDK
192
+ */
89
193
  changeMetadata: (metadata: string) => void;
194
+ /**
195
+ * - startRTMPOrRecording takes a configuration object {@link HMSRTMPConfig} and stats the RTMP recording
196
+ * - this object of {@link HMSRTMPConfig} sets the urls for streaming and weather to set recording on or not
197
+ * - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
198
+ *
199
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
200
+ *
201
+ * @memberof HMSSDK
202
+ */
90
203
  startRTMPOrRecording: (data: HMSRTMPConfig) => Promise<any>;
204
+ /**
205
+ * - this function stops all the ongoing RTMP streaming and recording.
206
+ * - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
207
+ *
208
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
209
+ *
210
+ * @memberof HMSSDK
211
+ */
91
212
  stopRtmpAndRecording: () => Promise<any>;
213
+ /**
214
+ * - This function starts HLSStreaming.
215
+ * - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
216
+ *
217
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
218
+ *
219
+ * @param {HMSHLSConfig}
220
+ * @memberof HMSSDK
221
+ */
92
222
  startHLSStreaming: (data: HMSHLSConfig) => Promise<any>;
223
+ /**
224
+ * - stopHLSStreaming function stops the ongoing HLSStreams.
225
+ * - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
226
+ *
227
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
228
+ *
229
+ * @memberof HMSSDK
230
+ */
93
231
  stopHLSStreaming: () => Promise<any>;
232
+ /**
233
+ * - This function can be used in a situation when we want to change role hence manipulate their
234
+ * access and rights in the current room, it takes the peer {@link HMSPeer} whom role we want to change,
235
+ * role {@link HMSRole} which will be the new role for that peer and weather to forcefully change
236
+ * the role or ask the to accept the role change request using a boolean force.
237
+ *
238
+ * - if we change the role forcefully the peer's role will be updated without asking the peer
239
+ * otherwise the user will get the roleChangeRequest in roleChangeRequest listener.
240
+ * for more information on this checkout {@link onRoleChangeRequestListener}
241
+ *
242
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
243
+ *
244
+ * @memberof HMSSDK
245
+ */
94
246
  changeRole: (peer: HMSPeer, role: HMSRole, force?: boolean) => Promise<any>;
247
+ /**
248
+ * - This function can be used to manipulate mute status of any track.
249
+ * - Targeted peer affected by this action will get a callback in {@link onChangeTrackStateRequestListener}.
250
+ *
251
+ * * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-track-state} for more info
252
+ *
253
+ * @param {HMSTrack}
254
+ * @memberof HMSSDK
255
+ */
95
256
  changeTrackState: (track: HMSTrack, mute: boolean) => Promise<any>;
257
+ /**
258
+ * - changeTrackStateForRoles is an enhancement on the functionality of {@link changeTrackState}.
259
+ * - We can change mute status for all the tracks of peers having a particular role.
260
+ * - @param source determines the source of the track ex. video, audio etc.
261
+ * - The peers affected by this action will get a callback in {@link onChangeTrackStateRequestListener}.
262
+ *
263
+ * @memberof HMSSDK
264
+ */
96
265
  changeTrackStateForRoles: (mute: boolean, type?: HMSTrackType | undefined, source?: string | undefined, roles?: HMSRole[] | undefined) => Promise<any>;
266
+ /**
267
+ * - removePeer can forcefully disconnect a Peer from the room.
268
+ * - the user who's removed from this action will get a callback in {@link onRemovedFromRoomListener}.
269
+ *
270
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/remove-peer} for more info
271
+ *
272
+ * @memberof HMSSDK
273
+ */
97
274
  removePeer: (peer: HMSPeer, reason: string) => Promise<any>;
275
+ /**
276
+ * - endRoom can be used in a situation where we want to disconnect all the peers from current room
277
+ * and end the call.
278
+ * - everyone in the room will get an update of this action in {@link onRemovedFromRoomListener}.
279
+ *
280
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/end-room} for more info
281
+ *
282
+ * @memberof HMSSDK
283
+ */
98
284
  endRoom: (reason: string, lock?: boolean) => Promise<any>;
285
+ /**
286
+ * - This function can be used to change name of localPeer.
287
+ *
288
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-name} for more info
289
+ *
290
+ * @memberof HMSSDK
291
+ */
99
292
  changeName: (name: string) => Promise<any>;
293
+ /**
294
+ * - Calling this function will accept the most recent roleChange request made by anyone in the room
295
+ *
296
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
297
+ *
298
+ * @memberof HMSSDK
299
+ */
100
300
  acceptRoleChange: () => Promise<any>;
301
+ /**
302
+ * - setPlaybackForAllAudio is an extension of the abilities of {@link setPlaybackAllowed} in
303
+ * {@link HMSRemoteAudioTrack}, it sets mute status for all peers in the room
304
+ *
305
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/playback-allowed} for more info
306
+ *
307
+ * @memberof HMSSDK
308
+ */
101
309
  setPlaybackForAllAudio: (mute: boolean) => void;
310
+ /**
311
+ * - This function mutes audio for all peers in the room.
312
+ *
313
+ * @memberof HMSSDK
314
+ */
102
315
  remoteMuteAllAudio: () => void;
316
+ /**
317
+ * - getRoom is a wrapper function on an existing native function also known as getRoom the returns
318
+ * current room object which is of type {@link HMSRoom}
319
+ *
320
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/room} for more info
321
+ *
322
+ * @memberof HMSSDK
323
+ * @return HMSRoom
324
+ */
103
325
  getRoom: () => Promise<HMSRoom>;
326
+ /**
327
+ * - This function sets the volume of any peer in the room
328
+ *
329
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/set-volume} for more info
330
+ *
331
+ * @memberof HMSSDK
332
+ */
104
333
  setVolume: (track: HMSTrack, volume: number) => void;
105
334
  resetVolume: () => void;
335
+ /**
336
+ * - This is a temporary solution for the situation when mic access is taken from the app and
337
+ * user returns to the app with no mic access. It will re-acquire the mic by setting the volume
338
+ * from native side
339
+ *
340
+ * @memberof HMSSDK
341
+ */
106
342
  addAppStateListener: () => void;
107
- startScreenshare: () => void;
343
+ /**
344
+ * - This function is used to start screenshare, currently available only for android
345
+ *
346
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
347
+ *
348
+ * @memberof HMSSDK
349
+ */
350
+ startScreenshare: () => Promise<any>;
351
+ /**
352
+ * - Returns a boolean stating if the screen is currently shared or not
353
+ *
354
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
355
+ *
356
+ * @memberof HMSSDK
357
+ */
108
358
  isScreenShared: () => Promise<any>;
359
+ /**
360
+ * - stops the screenShare, currently available for android only.
361
+ *
362
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
363
+ *
364
+ * @memberof HMSSDK
365
+ */
109
366
  stopScreenshare: () => Promise<any>;
367
+ /**
368
+ * - enableRTCStats sets a boolean in native side which in turn allows several events to be passed
369
+ * through the bridge these events are {@link RTCStatsListener}, {@link onRemoteVideoStatsListener},
370
+ * {@link onRemoteAudioStatsListener}, {@link onLocalAudioStatsListener} and {@link onLocalVideoStatsListener}
371
+ *
372
+ * - These listeners get various dataPoints for current peers and their connectivity to the room
373
+ * such as jitter, latency etc.
374
+ *
375
+ * - currently available for iOS only
376
+ *
377
+ * @memberof HMSSDK
378
+ */
110
379
  enableRTCStats: () => void;
380
+ /**
381
+ * - disable RTCStats sets the same boolean to false that was set true by enableRTCStats.
382
+ * that activates a check which filters out the events acquired in native listeners and don't
383
+ * let them pass through bridge
384
+ *
385
+ * - currently available for iOS only.
386
+ * @memberof HMSSDK
387
+ */
111
388
  disableRTCStats: () => void;
112
389
  /**
113
390
  * - This is a prototype event listener that takes action and listens for updates related to that particular action
114
- * - This method will be @deprecated in future and event listener will be passed in join method
115
391
  *
116
392
  * @param {string} action
117
393
  * @param {*} callback
@@ -120,7 +396,6 @@ export declare class HMSSDK {
120
396
  addEventListener: (action: HMSUpdateListenerActions, callback: any) => void;
121
397
  /**
122
398
  * - This is a prototype event listener that takes action and listens for updates related to that particular action
123
- * - This method will be @deprecated in future and event listener will be passed in join method
124
399
  *
125
400
  * @param {string} action
126
401
  * @param {*} callback
@@ -133,6 +408,20 @@ export declare class HMSSDK {
133
408
  * @memberof HMSSDK
134
409
  */
135
410
  removeAllListeners: () => void;
411
+ /**
412
+ * - Below are all the listeners that are connected to native side.
413
+ *
414
+ * - All of the are connected when build function is called, we can connect them to the app by
415
+ * calling {@link addEventListener} with corresponding event type.
416
+ *
417
+ * - Before passing the data to the eventListener of the app these listeners encode the data in
418
+ * ts classes for a proper structuring of the data.
419
+ *
420
+ * - Even When event listeners of the app are disconnected using {@link removeEventListener} or
421
+ * {@link removeAllListeners} or not even connected in first place, these functions still run to
422
+ * maintain the current state of the instance of {@link HMSSDK}.
423
+ *
424
+ */
136
425
  onPreviewListener: (data: any) => void;
137
426
  onJoinListener: (data: any) => void;
138
427
  onRoomListener: (data: any) => void;
@@ -6,8 +6,10 @@ interface HmsComponentProps {
6
6
  sink: boolean;
7
7
  style: ViewStyle;
8
8
  mirror?: boolean;
9
- scaleType: HMSVideoViewMode;
9
+ scaleType?: HMSVideoViewMode;
10
+ setZOrderMediaOverlay?: boolean;
11
+ screenshot?: boolean;
10
12
  id?: string | null;
11
13
  }
12
- export declare const HmsView: ({ sink, trackId, style, id, mirror, scaleType, }: HmsComponentProps) => JSX.Element;
14
+ export declare const HmsView: ({ sink, trackId, style, id, mirror, setZOrderMediaOverlay, scaleType, screenshot, }: HmsComponentProps) => JSX.Element;
13
15
  export {};
@@ -57,5 +57,10 @@ export * from './classes/HMSRTCStats';
57
57
  export * from './classes/HMSRTCStatsReport';
58
58
  export * from './classes/HMSRemoteAudioStats';
59
59
  export * from './classes/HMSRemoteVideoStats';
60
+ export * from './classes/HMSHLSRecordingConfig';
61
+ export * from './classes/HMSHLSRecordingState';
62
+ export * from './classes/HMSMessageRecipient';
63
+ export * from './classes/HMSMessageRecipientType';
64
+ export * from './classes/HMSNetworkQuality';
60
65
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
61
66
  export default HmsManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@100mslive/react-native-hms",
3
- "version": "0.9.1",
3
+ "version": "0.9.4",
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", "0.2.7"
19
+ s.dependency "HMSSDK", "0.2.9"
20
20
  end